Documentation
¶
Index ¶
- Constants
- type Account
- type AccountResp
- type AccountSetting
- type ApiF
- type ApiV2
- func (a *ApiV2) Create(body ...[]byte) (VideoV2, error)
- func (a *ApiV2) CreateAccount(name string, type_ string) string
- func (a *ApiV2) CreateAssetSettings(assetId string, settingIds []string) error
- func (a *ApiV2) GetAccount(id string) (account Account, err error)
- func (a *ApiV2) GetAsset(id string) (asset Asset, err error)
- func (a *ApiV2) GetAssetList() ([]Asset, error)
- func (a *ApiV2) GetRawVideos(accountId string) ([]json.RawMessage, error)
- func (a *ApiV2) GetSettingsByName(settingsName string) (settings Settings, err error)
- func (a *ApiV2) GetUploadParams(vid string, params upload.UploadRequest) (up upload.UploadParameters, err error)
- func (a *ApiV2) GetVideo(id string) (video VideoV2, err error)
- func (a *ApiV2) GetVideos(accountId string) ([]VideoV2, error)
- func (a ApiV2) ParseError(status int, bytes []byte) error
- func (a *ApiV2) SetApi(video *VideoV2)
- func (a *ApiV2) UpdateAssetMetadata(id string, metadata json.RawMessage) (asset Asset, err error)
- func (a ApiV2) Version() string
- type Asset
- type AssetList
- type AssetResponse
- type AssetUpload
- type AwsError
- type BaseApi
- type Distributor
- type ErrorRespV2
- type LoginResp
- type Settings
- type SettingsResp
- type VideoAccount
- type VideoList
- type VideoResp
- type VideoV2
- func (v *VideoV2) AddAccount(accountId string) error
- func (v *VideoV2) CreateAsset(state, fileType, location string) (Asset, error)
- func (v *VideoV2) CreateAssetForUpload(req upload.UploadRequest) (asset Asset, err error)
- func (v *VideoV2) CreateOrUpdateAsset(asset *Asset) error
- func (v *VideoV2) Display() (str string)
- func (v *VideoV2) FindAsset(location string) (Asset, bool)
- func (v *VideoV2) FindAssetByType(assetType string) ([]Asset, bool)
- func (v VideoV2) GetAsset(assetId string) (Asset, error)
- func (v *VideoV2) GetBaseUrl() string
- func (v *VideoV2) GetUploadParams(req upload.UploadRequest) (up upload.UploadParameters, err error)
- func (v *VideoV2) GetVideoAssetList() error
- func (v *VideoV2) Scan(src interface{}) error
- func (v *VideoV2) Update() error
- func (v VideoV2) Value() (driver.Value, error)
Constants ¶
View Source
const ( DEFAULT_V2_URL = "https://b9n2fsyd6jbfihx82.stoplight-proxy.io" DEFAULT_UPLOADER_URL = "https://s6krcbatzuuhmspse.stoplight-proxy.io" DEFAULT_PAGE_SIZE = 100 SYNQ_VERSION = "v2" SYNQ_ROUTE = "v1" )
View Source
const ( DEFAULT_TIMEOUT_MS = 5000 // 5 seconds DEFAULT_UPLOAD_MS = 600000 // 5 minutes )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Id string `json:"id"` Name string `json:"name"` Type string `json:"type"` Status string `json:"status"` Domain string `json:"domain"` Contact string `json:"contact_person"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` PartneredOn string `json:"partnered_on"` AccountSettings []AccountSetting `json:"account_settings"` Distributors []Distributor `json:"distributor_accounts"` }
type AccountResp ¶
type AccountResp struct {
Account Account `json:"data"`
}
type AccountSetting ¶
type ApiV2 ¶
type ApiV2 struct { *BaseApi User string Password string UploadUrl string TokenExpiry time.Time PageSize int }
func (*ApiV2) CreateAssetSettings ¶
func (*ApiV2) GetAssetList ¶
func (*ApiV2) GetRawVideos ¶
func (a *ApiV2) GetRawVideos(accountId string) ([]json.RawMessage, error)
func (*ApiV2) GetSettingsByName ¶
func (*ApiV2) GetUploadParams ¶
func (a *ApiV2) GetUploadParams(vid string, params upload.UploadRequest) (up upload.UploadParameters, err error)
func (*ApiV2) UpdateAssetMetadata ¶
type Asset ¶
type Asset struct { AccountId string `json:"account_id"` VideoId string `json:"video_id"` Id string `json:"id"` Location string `json:"location"` Url string `json:"url"` State string `json:"state"` Type string `json:"type"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Metadata json.RawMessage `json:"metadata"` VmafScore float64 `json:"vmaf_score"` UploadInfo AssetUpload `json:"upload_info,omitempty"` Api ApiV2 `json:"-"` Video VideoV2 `json:"-"` UploadParameters upload.UploadParameters `json:"-"` }
func (*Asset) UploadFile ¶
type AssetResponse ¶
type AssetResponse struct {
Asset *Asset `json:"data"`
}
type AssetUpload ¶
type BaseApi ¶
type Distributor ¶
type Distributor struct {
DistributorId string `json:"distributor_id"`
}
type ErrorRespV2 ¶
type ErrorRespV2 struct {
Message string `json:"message"`
}
type SettingsResp ¶
type SettingsResp struct {
Settings Settings `json:"data"`
}
type VideoAccount ¶
type VideoAccount struct {
Id string `json:"account_id"`
}
type VideoList ¶
type VideoList struct { Videos []json.RawMessage `json:"data"` PageSize int `json:"page_size"` PageNumber int `json:"page_number"` }
type VideoV2 ¶
type VideoV2 struct { Id string `json:"id"` Userdata json.RawMessage `json:"user_data"` Metadata json.RawMessage `json:"metadata"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Api *ApiV2 `json:"-"` Assets []Asset `json:"assets"` AccountIds []string `json:"account_ids"` CompletenessScore float64 `json:"completeness_score"` }
func (*VideoV2) AddAccount ¶
func (*VideoV2) CreateAsset ¶
func (*VideoV2) CreateAssetForUpload ¶
func (v *VideoV2) CreateAssetForUpload(req upload.UploadRequest) (asset Asset, err error)
This will call Unicorn's /v2/video/<id>/upload API, which will create an asset and create a signed S3 location to upload to, including the signature url for multipart uploads
func (*VideoV2) CreateOrUpdateAsset ¶
func (*VideoV2) FindAssetByType ¶
func (*VideoV2) GetBaseUrl ¶
func (*VideoV2) GetUploadParams ¶
func (v *VideoV2) GetUploadParams(req upload.UploadRequest) (up upload.UploadParameters, err error)
This will get the upload params for a sepcific video, if assetId is passed in it will be used instead (assuming it exists)
func (*VideoV2) GetVideoAssetList ¶
Click to show internal directories.
Click to hide internal directories.