vod

package module
v0.0.0-...-62f59fa Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 12 Imported by: 0

README

logo

简介

VOD Go SDK 是基于云点播上传功能进行包装的 Go 版本 SDK,SDK 中提供丰富的上传能力,满足大部分开发者的上传需求。除此之外,SDK 包装了云点播的 API,开发者在使用上非常方便,不需要关注太多细节即可完成上传功能的对接。

功能特性

  • 普通文件上传
  • HLS文件上传
  • 携带封面上传
  • 子应用上传
  • 上传携带任务流
  • 指定上传园区
  • 支持使用临时密钥上传
  • 设置代理上传

文档

安装

go get -u github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common
go get -u github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod
go get -u github.com/tencentyun/cos-go-sdk-v5
go get -u github.com/tencentyun/vod-go-sdk

测试

SDK 提供了丰富的测试用例,开发者可以参考示例的调用方式,具体参考:测试用例。 开发者可以通过运行命令查看测试用例的执行情况:

go test

变更记录

每个版本的变更细节都记录在日志中,具体请看:变更日志

贡献者

感谢以下的开发者对项目的大力支持,欢迎更多的开发者参与进来!

许可证

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExist

func FileExist(target string) bool

FileExist returns whether the file exists.

func GetFileName

func GetFileName(target string) string

GetFileName returns the file name without suffix.

func GetFileType

func GetFileType(target string) string

GetFileType returns the file type.

func IsEmptyStr

func IsEmptyStr(target *string) bool

IsEmptyStr returns whether the string is empty.

func IsManifestMediaType

func IsManifestMediaType(mediaType string) bool

IsManifestMediaType returns whether the media type is manifest.

func NotEmptyStr

func NotEmptyStr(target *string) bool

NotEmptyStr returns whether the string is not empty.

Types

type ClientError

type ClientError struct {
	Message string
}

ClientError is the error returned by VOD service.

func (*ClientError) Error

func (e *ClientError) Error() string

Error formats error.

func (*ClientError) GetMessage

func (e *ClientError) GetMessage() string

GetMessage returns the error message.

type UploadClient

type UploadClient struct {
	SecretId  string
	SecretKey string
	Token     string
	Timeout   int64
	Transport http.RoundTripper
}

UploadClient is the client of vod upload.

func (*UploadClient) Upload

func (p *UploadClient) Upload(region string, request *UploadRequest) (*UploadResponse, error)

Upload uploads the file to vod.

func (*UploadClient) UploadFromUrl

func (p *UploadClient) UploadFromUrl(region string, request *UploadRequest) (*UploadResponse, error)

UploadFromUrl uploads the file from url to vod.

type UploadRequest

type UploadRequest struct {
	v20180717.ApplyUploadRequest
	MediaFilePath          *string
	CoverFilePath          *string
	ConcurrentUploadNumber *uint64
	MediaUrl               *string
	CoverUrl               *string
}

UploadRequest is the request struct for api Upload

func NewVodUploadRequest

func NewVodUploadRequest() *UploadRequest

NewVodUploadRequest creates a request to invoke Upload API

type UploadResponse

type UploadResponse struct {
	v20180717.CommitUploadResponse
}

UploadResponse is the response struct for api Upload

Jump to

Keyboard shortcuts

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