mts

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ver = "2014-06-18"
)

API constants

Variables

This section is empty.

Functions

func QueryJobsAPI

func QueryJobsAPI(id string, rest ...string) aliyun.API

QueryJobsAPI returns a API for QueryJobList. It accepts one or more (at most 10) JobIDs for query. https://help.aliyun.com/document_detail/29228.html

func SubmitJobsAPI

func SubmitJobsAPI(r *SubmitJobsRequest) aliyun.API

SubmitJobsAPI returns a API for SubmitJobs. https://help.aliyun.com/document_detail/29226.html

Types

type JobIO added in v0.0.6

type JobIO struct {
	Bucket   string `json:"Bucket"`
	Location string `json:"Location"`
	Object   string `json:"Object"`
}

JobIO is the job input/output.

type JobInfo

type JobInfo struct {
	JobID        string          `json:"JobId"`
	Input        JobIO           `json:"Input"`
	Output       json.RawMessage `json:"Output"`
	State        string          `json:"State"`
	Code         string          `json:"Code"`
	Message      string          `json:"Message"`
	Percent      int             `json:"Percent"`
	PipelineID   string          `json:"PipelineId"`
	CreationTime time.Time       `json:"CreationTime"`
	FinishTime   time.Time       `json:"FinishTime"`
}

A JobInfo represents the info for one job. The Output has too many fields so it's marshalled to raw bytes.

type JobOutputInfo added in v0.0.6

type JobOutputInfo struct {
	OutputFile JobIO           `json:"OutputFile"`
	UserData   string          `json:"UserData"`
	Priority   string          `json:"Priority"`
	Properties json.RawMessage `json:"Properties"`
	ExtendData string          `json:"ExtendData"`
	TemplateID string          `json:"TemplateId"`
}

JobOutputInfo is a mapping for JobInfo.Output. This is NOT mean to be completed.

type JobResult

type JobResult struct {
	Success bool    `json:"Success"`
	Code    string  `json:"Code"`
	Message string  `json:"Message"`
	Job     JobInfo `json:"Job"`
}

A JobResult gives the result of a job.

type Querier

type Querier interface {
	Query(id string, rest ...string) (QueryJobsResponse, error)
}

A Querier queries a transcoding job.

type QueryJobsResponse

type QueryJobsResponse struct {
	NonExistJobIDs struct {
		IDs []string `json:"String,omitempty"`
	} `json:"NonExistJobIds"`
	RequestID string `json:"RequestId"`
	JobList   struct {
		Job []JobInfo `json:"Job"`
	} `json:"JobList"`
}

A QueryJobsResponse contains the response for QueryJobList.

type SubmitJobsRequest

type SubmitJobsRequest struct {
	Input          string `json:"Input"`
	OutputBucket   string `json:"OutputBucket"`
	OutputLocation string `json:"OutputLocation"`
	Outputs        string `json:"Outputs"`
	PipelineID     string `json:"PipelineId"`
	RegionID       string `json:"RegionId"`
}

A SubmitJobsRequest contains the param for submitting a transcoding job. Only the OutputLocation is optional and default to "oss-cn-hangzhou".

type SubmitJobsResponse

type SubmitJobsResponse struct {
	RequestID string `json:"RequestId"`
	List      struct {
		Result []JobResult `json:"JobResult"`
	} `json:"JobResultList"`
}

A SubmitJobsResponse contains the response for SubmitJobs.

type Submitter

type Submitter interface {
	Submit(*SubmitJobsRequest) (SubmitJobsResponse, error)
}

A Submitter submits a transcoding job.

type Transcoder

type Transcoder interface {
	Submitter
	Querier
}

A Transcoder wraps a Submitter & a Querier.

func New

func New(s aliyun.Signer, host string) Transcoder

New returns a new Transcoder with a 10s-timeout HTTP client.

Jump to

Keyboard shortcuts

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