Documentation ¶
Index ¶
- Constants
- Variables
- func BuildSign(dsa, version, timestamp string, key []byte) string
- func GetDate(t time.Time) string
- type AdvanceOption
- type ApplyUploadParam
- type ApplyUploadResp
- type ApplyUploadResult
- type BaseResp
- type CommitUploadBody
- type CommitUploadParam
- type CommitUploadResp
- type CommitUploadResult
- type DomainInfo
- type Encryption
- type EntryptionInput
- type FileType
- type Function
- type GetWeightsResp
- type ImageMeta
- type ImgUrl
- type ModifyVideoInfoBaseResp
- type ModifyVideoInfoBody
- type ModifyVideoInfoResp
- type ObjectMeta
- type OptionFun
- func WithFormat(format string) OptionFun
- func WithHttps() OptionFun
- func WithKV(kv url.Values) OptionFun
- func WithSig(key string) OptionFun
- func WithVodNoop() OptionFun
- func WithVodTplCenterCrop(width, height int) OptionFun
- func WithVodTplObj() OptionFun
- func WithVodTplResize(width, height int) OptionFun
- func WithVodTplSmartCrop(width, height int) OptionFun
- type OptionInfo
- type PublicErrorCode
- type SetVideoPublishStatusResp
- type SnapshotInput
- type StartWorkflowRequest
- type StartWorkflowResp
- type StartWorkflowResult
- type StoreInfo
- type TagControl
- type UploadAddress
- type UploadMediaByUrlParams
- type UploadMediaByUrlResp
- type UploadMediaByUrlResult
- type UploadResult
- type UserMetaInfo
- type VideoDefinition
- type VideoFormat
- type VideoMeta
- type Vod
- func (p *Vod) ApplyUploadInfo(req *request.VodApplyUploadInfoRequest) (*response.VodApplyUploadInfoResponse, int, error)
- func (p *Vod) CommitUploadInfo(req *request.VodCommitUploadInfoRequest) (*response.VodCommitUploadInfoResponse, int, error)
- func (p *Vod) GetMediaInfos(req *request.VodGetMediaInfosRequest) (*response.VodGetMediaInfosResponse, int, error)
- func (p *Vod) GetPlayAuthToken(req *request.VodGetPlayInfoRequest, tokenExpireTime int) (string, error)
- func (p *Vod) GetPlayInfo(req *request.VodGetPlayInfoRequest) (*response.VodGetPlayInfoResponse, int, error)
- func (p *Vod) GetPlayInfoWithLiveTimeShiftScene(req *request.VodGetPlayInfoWithLiveTimeShiftSceneRequest) (*response.VodGetPlayInfoWithLiveTimeShiftSceneResponse, int, error)
- func (p *Vod) GetSubtitleAuthToken(req *request.VodGetSubtitleInfoListRequest, tokenExpireTime int) (string, error)
- func (p *Vod) GetUploadAuth() (*base.SecurityToken2, error)
- func (p *Vod) GetUploadAuthWithExpiredTime(expiredTime time.Duration) (*base.SecurityToken2, error)
- func (p *Vod) ListDomain(req *request.VodListDomainRequest) (*response.VodListDomainResponse, int, error)
- func (p *Vod) ListSpace(req *request.VodListSpaceRequest) (*response.VodListSpaceResponse, int, error)
- func (p *Vod) UpdateSpaceUploadConfig(req *request.VodUpdateSpaceUploadConfigRequest) (*response.VodUpdateSpaceUploadConfigResponse, int, error)
- func (p *Vod) Upload(rd io.Reader, size int64, spaceName string, fileType string, ...) (string, string, error, int)
- func (p *Vod) UploadMaterialWithCallback(materialRequest *request.VodUploadMaterialRequest) (*response.VodCommitUploadInfoResponse, int, error)
- func (p *Vod) UploadMediaInner(rd io.Reader, size int64, spaceName string, fileType, callbackArgs string, ...) (*response.VodCommitUploadInfoResponse, int, error)
- func (p *Vod) UploadMediaWithCallback(mediaRequset *request.VodUploadMediaRequest) (*response.VodCommitUploadInfoResponse, int, error)
- func (p *Vod) UploadObjectWithCallback(filePath string, spaceName string, callbackArgs string, ...) (*response.VodCommitUploadInfoResponse, int, error)
- type WorkflowInput
Constants ¶
View Source
const ( DSAHmacSha1 = "HMAC-SHA1" Version2 = "2.0" SprAuth = ":" SprSign = "&" DateYYYYMMDDTHHmmss = "20060102T150405Z" )
View Source
const ( FORMAT_JPEG = "jpeg" FORMAT_PNG = "png" FORMAT_WEBP = "webp" FORMAT_AWEBP = "awebp" FORMAT_GIF = "gif" FORMAT_HEIC = "heic" FORMAT_ORIGINAL = "image" HTTP = "http" HTTPS = "https" KEY_SIG = "sig" VOD_TPL_OBJ = "tplv-vod-obj" VOD_TPL_NOOP = "tplv-vod-noop" VOD_TPL_RESIZE = "tplv-vod-rs" VOD_TPL_CENTER_CROP = "tplv-vod-cc" VOD_TPL_SMART_CROP = "tplv-vod-cs" VOD_TPL_SIG = "tplv-bd-sig" )
Variables ¶
View Source
var ( ServiceVOD = []byte("vod") ErrAccessKeyInvalid = errors.New("access key invalid") ErrSecretKeyInvalid = errors.New("secret key invalid") )
View Source
var ( ServiceInfoMap = map[string]*base.ServiceInfo{ base.RegionApSingapore: { Timeout: 60 * time.Second, Host: "vod.byteplusapi.com", Header: http.Header{ "Accept": []string{"application/json"}, }, Credentials: base.Credentials{Region: base.RegionApSingapore, Service: "vod"}, }, } ApiInfoList = map[string]*base.ApiInfo{ "GetPlayInfo": { Method: http.MethodGet, Path: "/", Query: url.Values{ "Action": []string{"GetPlayInfo"}, "Version": []string{"2023-01-01"}, }, }, "GetPlayInfoWithLiveTimeShiftScene": { Method: http.MethodGet, Path: "/", Query: url.Values{ "Action": []string{"GetPlayInfoWithLiveTimeShiftScene"}, "Version": []string{"2023-01-01"}, }, }, "ApplyUploadInfo": { Method: http.MethodGet, Path: "/", Query: url.Values{ "Action": []string{"ApplyUploadInfo"}, "Version": []string{"2023-01-01"}, }, }, "CommitUploadInfo": { Method: http.MethodGet, Path: "/", Query: url.Values{ "Action": []string{"CommitUploadInfo"}, "Version": []string{"2023-01-01"}, }, Timeout: 8 * time.Second, }, "GetSubtitleInfoList": { Method: http.MethodGet, Path: "/", Query: url.Values{ "Action": []string{"GetSubtitleInfoList"}, "Version": []string{"2023-01-01"}, }, }, "GetMediaInfos": { Method: http.MethodGet, Path: "/", Query: url.Values{ "Action": []string{"GetMediaInfos"}, "Version": []string{"2023-01-01"}, }, }, "ListSpace": { Method: http.MethodGet, Path: "/", Query: url.Values{ "Action": []string{"ListSpace"}, "Version": []string{"2023-01-01"}, }, }, "UpdateSpaceUploadConfig": { Method: http.MethodGet, Path: "/", Query: url.Values{ "Action": []string{"UpdateSpaceUploadConfig"}, "Version": []string{"2023-01-01"}, }, }, "ListDomain": { Method: http.MethodGet, Path: "/", Query: url.Values{ "Action": []string{"ListDomain"}, "Version": []string{"2023-01-01"}, }, }, } )
View Source
var (
ErrKvSig = errors.New("Input kv already has sig query")
)
Functions ¶
Types ¶
type AdvanceOption ¶
type ApplyUploadParam ¶
type ApplyUploadResp ¶
type ApplyUploadResp struct { base.CommonResponse Result ApplyUploadResult }
type ApplyUploadResult ¶
type ApplyUploadResult struct { RequestID string UploadAddress UploadAddress }
type CommitUploadBody ¶
type CommitUploadParam ¶
type CommitUploadParam struct { SpaceName string Body CommitUploadBody }
type CommitUploadResp ¶
type CommitUploadResp struct { base.CommonResponse Result CommitUploadResult }
type CommitUploadResult ¶
type CommitUploadResult struct { RequestId string CallbackArgs string Results []UploadResult }
type DomainInfo ¶
type Encryption ¶
type EntryptionInput ¶
type GetWeightsResp ¶
type GetWeightsResp struct { ResponseMetadata *base.ResponseMetadata Result map[string]map[string]int `json:",omitempty"` }
type ModifyVideoInfoBaseResp ¶
type ModifyVideoInfoBaseResp struct {
BaseResp *BaseResp
}
type ModifyVideoInfoBody ¶
type ModifyVideoInfoBody struct { SpaceName string `json:"SpaceName"` Vid string `json:"Vid"` Info UserMetaInfo `json:"Info"` Tags TagControl `json:"Tags"` }
type ModifyVideoInfoResp ¶
type ModifyVideoInfoResp struct { ResponseMetadata *base.ResponseMetadata Result *ModifyVideoInfoBaseResp }
type ObjectMeta ¶
type OptionFun ¶
type OptionFun func(*option)
func WithFormat ¶
func WithVodNoop ¶
func WithVodNoop() OptionFun
func WithVodTplCenterCrop ¶
func WithVodTplObj ¶
func WithVodTplObj() OptionFun
func WithVodTplResize ¶
func WithVodTplSmartCrop ¶
type OptionInfo ¶
type PublicErrorCode ¶
type PublicErrorCode string
type SetVideoPublishStatusResp ¶
type SetVideoPublishStatusResp struct {
ResponseMetadata *base.ResponseMetadata
}
SetVideoPublishStatus
type SnapshotInput ¶
type SnapshotInput struct {
SnapshotTime float64
}
type StartWorkflowRequest ¶
type StartWorkflowResp ¶
type StartWorkflowResp struct { ResponseMetadata *base.ResponseMetadata Result *StartWorkflowResult `json:",omitempty"` }
type StartWorkflowResult ¶
type StartWorkflowResult struct {
RunId string
}
type TagControl ¶
type UploadAddress ¶
type UploadMediaByUrlParams ¶
type UploadMediaByUrlParams struct { SpaceName string Format VideoFormat SourceUrls []string CallbackArgs string }
type UploadMediaByUrlResp ¶
type UploadMediaByUrlResp struct { base.CommonResponse Result UploadMediaByUrlResult }
type UploadMediaByUrlResult ¶
type UploadResult ¶
type UploadResult struct { Vid string VideoMeta VideoMeta ImageMeta ImageMeta ObjectMeta ObjectMeta Encryption Encryption SnapshotUri string }
type UserMetaInfo ¶
type VideoDefinition ¶
type VideoDefinition string
const ( D1080P VideoDefinition = "1080p" D720P VideoDefinition = "720p" D540P VideoDefinition = "540p" D480P VideoDefinition = "480p" D360P VideoDefinition = "360p" D240P VideoDefinition = "240p" )
type VideoFormat ¶
type VideoFormat string
const ( MP4 VideoFormat = "mp4" M3U8 VideoFormat = "m3u8" )
type Vod ¶
func NewInstance ¶
func NewInstance() *Vod
func NewInstanceWithRegion ¶
func (*Vod) ApplyUploadInfo ¶
func (p *Vod) ApplyUploadInfo(req *request.VodApplyUploadInfoRequest) (*response.VodApplyUploadInfoResponse, int, error)
ApplyUploadInfo
- @param *request.VodApplyUploadInfoRequest
- @return *response.VodApplyUploadInfoResponse, int, error
func (*Vod) CommitUploadInfo ¶
func (p *Vod) CommitUploadInfo(req *request.VodCommitUploadInfoRequest) (*response.VodCommitUploadInfoResponse, int, error)
CommitUploadInfo
- @param *request.VodCommitUploadInfoRequest
- @return *response.VodCommitUploadInfoResponse, int, error
func (*Vod) GetMediaInfos ¶
func (p *Vod) GetMediaInfos(req *request.VodGetMediaInfosRequest) (*response.VodGetMediaInfosResponse, int, error)
GetMediaInfos
- @param *request.VodGetMediaInfosRequest
- @return *response.VodGetMediaInfosResponse, int, error
func (*Vod) GetPlayAuthToken ¶
func (*Vod) GetPlayInfo ¶
func (p *Vod) GetPlayInfo(req *request.VodGetPlayInfoRequest) (*response.VodGetPlayInfoResponse, int, error)
GetPlayInfo
- @param *request.VodGetPlayInfoRequest
- @return *response.VodGetPlayInfoResponse, int, error
func (*Vod) GetPlayInfoWithLiveTimeShiftScene ¶
func (p *Vod) GetPlayInfoWithLiveTimeShiftScene(req *request.VodGetPlayInfoWithLiveTimeShiftSceneRequest) (*response.VodGetPlayInfoWithLiveTimeShiftSceneResponse, int, error)
GetPlayInfoWithLiveTimeShiftScene
- @param *request.VodGetPlayInfoWithLiveTimeShiftSceneRequest
- @return *response.VodGetPlayInfoWithLiveTimeShiftSceneResponse, int, error
func (*Vod) GetSubtitleAuthToken ¶
func (*Vod) GetUploadAuth ¶
func (p *Vod) GetUploadAuth() (*base.SecurityToken2, error)
func (*Vod) GetUploadAuthWithExpiredTime ¶
func (*Vod) ListDomain ¶
func (p *Vod) ListDomain(req *request.VodListDomainRequest) (*response.VodListDomainResponse, int, error)
ListDomain
- @param *request.VodListDomainRequest
- @return *response.VodListDomainResponse, int, error
func (*Vod) ListSpace ¶
func (p *Vod) ListSpace(req *request.VodListSpaceRequest) (*response.VodListSpaceResponse, int, error)
ListSpace
- @param *request.VodListSpaceRequest
- @return *response.VodListSpaceResponse, int, error
func (*Vod) UpdateSpaceUploadConfig ¶
func (p *Vod) UpdateSpaceUploadConfig(req *request.VodUpdateSpaceUploadConfigRequest) (*response.VodUpdateSpaceUploadConfigResponse, int, error)
UpdateSpaceUploadConfig
- @param *request.VodUpdateSpaceUploadConfigRequest
- @return *response.VodUpdateSpaceUploadConfigResponse, int, error
func (*Vod) UploadMaterialWithCallback ¶
func (p *Vod) UploadMaterialWithCallback(materialRequest *request.VodUploadMaterialRequest) (*response.VodCommitUploadInfoResponse, int, error)
func (*Vod) UploadMediaInner ¶
func (*Vod) UploadMediaWithCallback ¶
func (p *Vod) UploadMediaWithCallback(mediaRequset *request.VodUploadMediaRequest) (*response.VodCommitUploadInfoResponse, int, error)
type WorkflowInput ¶
type WorkflowInput struct {
TemplateId string
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.