api

package
v0.9.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Overview

Package api defines all APIs supported by the VCR service of BCE.

Package api defines all APIs supported by the VCR service of BCE.

Index

Constants

View Source
const (
	URI_PREFIX = bce.URI_PREFIX + "v1"
	MEDIA_URI  = "/media"
	TEXT_URI   = "/text"
)

Variables

This section is empty.

Functions

func PutMedia

func PutMedia(cli bce.Client, args *PutMediaArgs) error

Types

type CheckError

type CheckError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type CheckResult

type CheckResult struct {
	Type  string       `json:"type"`
	Items []ResultItem `json:"items"`
}

type Evidence

type Evidence struct {
	Thumbnail string   `json:"thumbnail"`
	Location  Location `json:"location"`
	Text      string   `json:"text"`
}

type GetMediaResult

type GetMediaResult struct {
	Source       string        `json:"source"`
	MediaId      string        `json:"mediaId"`
	Description  string        `json:"description"`
	Preset       string        `json:"preset"`
	Status       string        `json:"status"`
	Percent      int           `json:"percent"`
	Notification string        `json:"notification"`
	CreateTime   string        `json:"createTime"`
	FinishTime   string        `json:"finishTime"`
	Label        string        `json:"label"`
	Results      []CheckResult `json:"results"`
	Error        CheckError    `json:"error"`
}

func GetMedia

func GetMedia(cli bce.Client, source string) (*GetMediaResult, error)

type Location

type Location struct {
	LeftOffsetInPixel int `json:"leftOffsetInPixel"`
	TopOffsetInPixel  int `json:"topOffsetInPixel"`
	WidthInPixel      int `json:"widthInPixel"`
	HeightInPixel     int `json:"heightInPixel"`
}

type PutMediaArgs

type PutMediaArgs struct {
	Source       string `json:"source"`
	Auth         string `json:"auth"`
	Description  string `json:"description"`
	Preset       string `json:"preset"`
	Notification string `json:"notification"`
}

type PutTextArgs

type PutTextArgs struct {
	Text   string `json:"text"`
	Preset string `json:"preset"`
}

type PutTextResult

type PutTextResult struct {
	Text    string        `json:"text"`
	Preset  string        `json:"preset"`
	Results []CheckResult `json:"results"`
}

func PutText

func PutText(cli bce.Client, args *PutTextArgs) (*PutTextResult, error)

type ResultItem

type ResultItem struct {
	SubType       string   `json:"subType"`
	Target        string   `json:"target"`
	TimeInSeconds int      `json:"timeInSeconds"`
	Confidence    float32  `json:"confidence"`
	Label         string   `json:"label"`
	Extra         string   `json:"extra"`
	Evidence      Evidence `json:"evidence"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL