Documentation ¶
Index ¶
- Variables
- type OssParam
- type Request
- type Response
- type ResponseError
- type SDK
- func (sdk *SDK) Get(action string, params map[string]string) (*Response, error)
- func (sdk *SDK) GetBytes(action string, params map[string]string) ([]byte, error)
- func (sdk *SDK) GetToken(code string) (*TokenResponse, error)
- func (sdk *SDK) GetUploader(name string, content []byte) *Uploader
- func (sdk *SDK) GetUploaderWithFile(name string) (*Uploader, error)
- func (sdk *SDK) Post(action string, params map[string]interface{}) *Response
- func (sdk *SDK) PostBytes(action string, params map[string]string) ([]byte, error)
- func (sdk *SDK) RefreshToken(token string) (*TokenResponse, error)
- func (sdk *SDK) SaveVideo(video *VideoParam, data *VideoData) (*VideoData, error)
- type SysParams
- type TokenResponse
- type UploadResponse
- type Uploader
- type VideoData
- type VideoParam
- type VideoResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var (
CHUNK_SIZE = int64(5 * 1024 * 1024) // 5M 分片
)
Functions ¶
This section is empty.
Types ¶
type OssParam ¶
type OssParam struct { Endpoint string `json:"endpoint"` ExpireTime string `json:"expire_time"` OssBucket string `json:"oss_bucket"` OssObject string `json:"oss_object"` SecurityToken string `json:"security_token"` TempAccessID string `json:"temp_access_id"` TempAccessSecret string `json:"temp_access_secret"` UploadToken string `json:"upload_token"` Vid string `json:"vid"` }
type Response ¶
type Response struct { Error ResponseError `json:"e"` Cost float64 `json:"cost"` Data interface{} `json:"data"` }
type ResponseError ¶
type SDK ¶
type SDK struct { ClientID string ClientSecret string AccessToken string User string Password string }
func (*SDK) GetUploaderWithFile ¶
func (*SDK) RefreshToken ¶
func (sdk *SDK) RefreshToken(token string) (*TokenResponse, error)
type SysParams ¶
type SysParams struct { Action string `json:"action"` ClientID string `json:"client_id"` AccessToken string `json:"access_token"` Format string `json:"format"` Timestamp string `json:"timestamp"` Version string `json:"version"` Sign string `json:"sign"` }
SysParams API定义的系统级别参数
type TokenResponse ¶
type TokenResponse struct { Errno int `json:"errno"` ErrText string `json:"errText"` Cost float64 `json:"cost"` Token struct { ExpireTime int `json:"expireTime"` RexpireTime int `json:"rexpireTime"` StartTime int64 `json:"startTime"` AccessToken string `json:"accessToken"` RefreshToken string `json:"refreshToken"` OpenId string `json:"openId"` } `json:"token"` }
type UploadResponse ¶
type UploadResponse struct { Error ResponseError `json:"e"` Cost float64 `json:"cost"` Data []OssParam `json:"data"` }
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
func (*Uploader) UploadAndSave ¶
func (uploader *Uploader) UploadAndSave(video *VideoParam, part bool) (*VideoData, error)
type VideoParam ¶
type VideoParam struct { Title string `json:"title"` Tags string `json:"tags"` Description string `json:"description,omitempty"` Original string `json:"original,omitempty"` CategoryName string `json:"category_name,omitempty"` SubcategoryIds string `json:"subcategory_ids,omitempty"` ThumbnailCustom string `json:"thumbnail_custom,omitempty"` }
type VideoResponse ¶
type VideoResponse struct { Error ResponseError `json:"e"` Cost float64 `json:"cost"` Data []VideoData `json:"data"` }
Click to show internal directories.
Click to hide internal directories.