Documentation ¶
Index ¶
- func CheckResponse(resp *http.Response) error
- func DoClientRequest(ctx context.Context, c *Client, req *http.Request) (*http.Response, error)
- type Client
- type Download
- type DownloadCli
- type DownloadCreateParams
- type DownloadService
- type DownloadTasksCli
- type DownloadTasksService
- type ErrorResponse
- type File
- type Geo
- type Link
- type LinkCreateRequest
- type Object
- type ObjectAdvanced
- type ObjectAudioStream
- type ObjectCreateRequest
- type ObjectFormat
- type ObjectUpdateRequest
- type ObjectVideoStream
- type ObjectsCli
- func (c ObjectsCli) Create(ctx context.Context, objectCreateRequest *ObjectCreateRequest) (*Object, *http.Response, error)
- func (c ObjectsCli) Delete(ctx context.Context, id string) (*http.Response, error)
- func (c ObjectsCli) Get(ctx context.Context, id string) (*Object, *http.Response, error)
- func (c ObjectsCli) List(ctx context.Context, params interface{}) ([]Object, *http.Response, error)
- func (c ObjectsCli) Update(ctx context.Context, id string, objectUpdateRequest *ObjectUpdateRequest) (*http.Response, error)
- type ObjectsListParams
- type ObjectsService
- type Paging
- type Player
- type PlayerCreateRequest
- type PlayerUpdateRequest
- type PlayersCli
- func (c PlayersCli) Create(ctx context.Context, playerCreateRequest *PlayerCreateRequest) (*Player, *http.Response, error)
- func (c PlayersCli) Delete(ctx context.Context, id string) (*http.Response, error)
- func (c PlayersCli) Get(ctx context.Context, id string) (*Player, *http.Response, error)
- func (c PlayersCli) List(ctx context.Context, params interface{}) ([]Player, *http.Response, error)
- func (c PlayersCli) Update(ctx context.Context, id string, playerUpdateRequest *PlayerUpdateRequest) (*http.Response, error)
- type PlayersService
- type Preset
- type Record
- type SecureLink
- type SecureLinkRequest
- type Storage
- type StorageCli
- type StorageService
- type Stream
- type StreamCreateRequest
- type StreamStartRequest
- type StreamsCli
- func (c StreamsCli) Create(ctx context.Context, streamCreateRequest *StreamCreateRequest) (*Stream, *http.Response, error)
- func (c StreamsCli) CreateSchedule(ctx context.Context, id string) (string, *http.Response, error)
- func (c StreamsCli) Delete(ctx context.Context, id string) (*http.Response, error)
- func (c StreamsCli) DeleteSchedule(ctx context.Context, streamID string, recordID string) (*http.Response, error)
- func (c StreamsCli) Get(ctx context.Context, id string) (*Stream, *http.Response, error)
- func (c StreamsCli) List(ctx context.Context) ([]Stream, *http.Response, error)
- func (c StreamsCli) Rec(ctx context.Context, id string) (*Record, *http.Response, error)
- func (c StreamsCli) Start(ctx context.Context, id string, streamStartRequest *StreamStartRequest) (*http.Response, error)
- func (c StreamsCli) Stop(ctx context.Context, id string) ([]File, *http.Response, error)
- type StreamsService
- type Task
- type TempCli
- func (c TempCli) Create(ctx context.Context, linkCreateRequest *LinkCreateRequest) (*Link, *http.Response, error)
- func (c TempCli) Delete(ctx context.Context, id string) (*http.Response, error)
- func (c TempCli) Get(ctx context.Context, id string) (*Link, *http.Response, error)
- func (c TempCli) List(ctx context.Context, params interface{}) ([]Link, *http.Response, error)
- func (c TempCli) Secure(ctx context.Context, id string, secureLinkRequest *SecureLinkRequest) (*SecureLink, *http.Response, error)
- type TempListParams
- type TempService
- type Transcoder
- type TranscoderCli
- func (c TranscoderCli) Concat(ctx context.Context, transcoderConcatRequest *TranscoderConcatRequest) (*Transcoder, *http.Response, error)
- func (c TranscoderCli) Create(ctx context.Context, id string, ...) (*Transcoder, *http.Response, error)
- func (c TranscoderCli) HLS(ctx context.Context, id string, transcoderHLSRequest *TranscoderHLSRequest) (*Transcoder, *http.Response, error)
- func (c TranscoderCli) Presets(ctx context.Context) ([]Preset, *http.Response, error)
- type TranscoderConcatRequest
- type TranscoderCreateRequest
- type TranscoderHLSRequest
- type TranscoderService
- type TranscoderTasksCli
- func (c TranscoderTasksCli) Delete(ctx context.Context, id string) (*http.Response, error)
- func (c TranscoderTasksCli) Get(ctx context.Context, id string) (*Task, *http.Response, error)
- func (c TranscoderTasksCli) HLS(ctx context.Context, id string) (*Task, *http.Response, error)
- func (c TranscoderTasksCli) List(ctx context.Context) ([]Task, *http.Response, error)
- type TranscoderTasksService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse checks response for errors
Types ¶
type Client ¶
type Client struct { UserAgent string BaseURL *url.URL // Authentication APIUserID string APIUserKey string // Services provides communication with API endpoints Objects ObjectsService Temp TempService Streams StreamsService Players PlayersService Download DownloadService DownloadTasks DownloadTasksService Transcoder TranscoderService TranscoderTasks TranscoderTasksService Storage StorageService // contains filtered or unexported fields }
Client manages communication with platformcraft API
type Download ¶
type Download struct { Message string `json:"message"` ActiveTasks int `json:"active_tasks"` TaskID string `json:"task_id"` }
Download represents a platformcraft Download
type DownloadCli ¶
type DownloadCli struct {
// contains filtered or unexported fields
}
DownloadCli handles communication with API
type DownloadCreateParams ¶
type DownloadCreateParams struct { URL string `url:"url,omitempty"` Path string `url:"path,omitempty"` Name string `url:"name,omitempty"` Autoencoding bool `url:"autoencoding,omitempty"` Presets string `url:"presets,omitempty"` DelOriginal bool `url:"del_original,omitempty"` Autoplayer bool `url:"autoplayer,omitempty"` }
DownloadCreateParams identifies as query params of Create request
type DownloadService ¶
type DownloadService interface {
Create(context.Context, interface{}) (*Download, *http.Response, error)
}
DownloadService implements interface with API /download endpoint. See https://doc.platformcraft.ru/filespot/api/en/#download
type DownloadTasksCli ¶
type DownloadTasksCli struct {
// contains filtered or unexported fields
}
DownloadTasksCli handles communication with API
type DownloadTasksService ¶
type DownloadTasksService interface { List(context.Context) ([]Task, *http.Response, error) Get(context.Context, string) (*Task, *http.Response, error) Delete(context.Context, string) (*http.Response, error) }
DownloadTasksService implements interface with API /download_tasks endpoint. See https://doc.platformcraft.ru/filespot/api/en/#download_tasks
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response Code uint32 `json:"code"` Status string `json:"status"` MsgUser string `json:"msg_user"` MsgDev string `json:"msg_dev"` Doc string `json:"doc"` Advanced string `json:"advanced"` }
ErrorResponse handles API errors
type File ¶
type File struct { ID string `json:"id"` Name string `json:"name"` Path string `json:"path"` Size int `json:"size"` ContentType string `json:"content_type"` CreateDate string `json:"create_date"` LatestUpdate string `json:"latest_update"` ResourceURL string `json:"resource_url"` Video string `json:"video"` CDNURL string `json:"cdn_url"` Status string `json:"status"` }
File represents a platformcraft Record File
type Geo ¶
Geo represents platformcraft `geo` type It's a map of `map[continent]map[country]true` Keys `continent` and `country` are ISO codes of continents and counties (e.g, EU и RU). All keys MUST be capitalized. When `country` was set to "ALL" it grants access to whole world. For example:
grants acccess to Europe and North America &Geo{ "EU": { "ALL": true, }, "NA": { "ALL": true, }, } grants access only to Russia &Geo{ "EU": { "RU": true, }, }
type Link ¶
type Link struct { ID string `json:"id"` ObjectID string `json:"object_id"` Href string `json:"href"` Secure bool `json:"secure"` Exp int `json:"exp"` ForSale bool `json:"for_sale"` Geo Geo `json:"geo"` }
Link represents a platformcraft temporary Link
type LinkCreateRequest ¶
type LinkCreateRequest struct { ObjectID string `json:"object_id"` Endless bool `json:"endless"` Exp int `json:"exp"` Secure bool `json:"secure"` Geo Geo `json:"geo"` }
LinkCreateRequest identifies Link for the Create request
type Object ¶
type Object struct { ID string `json:"id"` Name string `json:"name"` Path string `json:"path"` IsDir bool `json:"is_dir"` Size uint32 `json:"size"` ContentType string `json:"content_type"` CreateDate string `json:"create_date"` LatestUpdate string `json:"latest_update"` ResourceURL string `json:"resource_url"` CDNURL string `json:"cdn_url"` VODHLS string `json:"vod_hls"` Video string `json:"video"` Private bool `json:"private"` Status string `json:"status"` Advanced *ObjectAdvanced `json:"advanced"` Previews []string `json:"previews"` Description string `json:"description"` }
Object represents a platformcraft Object
type ObjectAdvanced ¶
type ObjectAdvanced struct { AudioStreams []ObjectAudioStream `json:"audio_streams"` Format *ObjectFormat `json:"format"` VideoStreams []ObjectVideoStream `json:"video_streams"` }
ObjectAdvanced of Object
type ObjectAudioStream ¶
type ObjectAudioStream struct { BitRate uint32 `json:"bit_rate"` ChannelLayout string `json:"channel_layout"` Channels uint32 `json:"channels"` CodecLongName string `json:"codec_long_name"` CodecType string `json:"codec_type"` Duration float32 `json:"duration"` Index uint32 `json:"index"` SampleRate uint32 `json:"sample_rate"` }
ObjectAudioStream of Object
type ObjectCreateRequest ¶
type ObjectCreateRequest struct { File string `url:"file"` Name string `url:"name,omitempty"` Private bool `url:"private,omitempty"` Autoencoding bool `url:"autoencoding,omitempty"` Presets string `url:"presets,omitempty"` DelOriginal bool `url:"del_original,omitempty"` Autoplayer bool `url:"autoplayer,omitempty"` }
ObjectCreateRequest identifies Object for the Create request
type ObjectFormat ¶
type ObjectFormat struct { BitRate uint32 `json:"bit_rate"` Duration float32 `json:"duration"` FormatLongName string `json:"format_long_name"` FormatName string `json:"format_name"` NBStreams uint32 `json:"nb_streams"` }
ObjectFormat of Object
type ObjectUpdateRequest ¶
type ObjectUpdateRequest struct { Name string `json:"name"` Folder string `json:"folder"` Description string `json:"description"` MaxHeight int `json:"max_height"` MaxWidth int `json:"max_width"` Private bool `json:"private"` }
ObjectUpdateRequest identifies Object for the Update request
type ObjectVideoStream ¶
type ObjectVideoStream struct { BitRate uint32 `json:"bit_rate"` CodecName string `json:"codec_name"` CodecType string `json:"codec_type"` CodecLongName string `json:"codeclongname"` DisplayAspectRatio string `json:"display_aspect_ratio"` Duration float32 `json:"duration"` FPS float32 `json:"fps"` Height uint32 `json:"height"` Index uint32 `json:"index"` Width uint32 `json:"width"` }
ObjectVideoStream of Object
type ObjectsCli ¶
type ObjectsCli struct {
// contains filtered or unexported fields
}
ObjectsCli handles communication with API
func (ObjectsCli) Create ¶
func (c ObjectsCli) Create(ctx context.Context, objectCreateRequest *ObjectCreateRequest) (*Object, *http.Response, error)
Create Object
func (ObjectsCli) Update ¶
func (c ObjectsCli) Update(ctx context.Context, id string, objectUpdateRequest *ObjectUpdateRequest) (*http.Response, error)
Update Object
type ObjectsListParams ¶
type ObjectsListParams struct { // Filters Folder string `url:"folder,omitempty"` Name string `url:"name,omitempty"` Ext string `url:"ext,omitempty"` Private bool `url:"private,omitempty"` ShowFolders bool `url:"show_folders,omitempty"` // Pagination Limit int `url:"limit,omitempty"` Start int `url:"start,omitempty"` Pagingts int `url:"pagingts,omitempty"` }
ObjectsListParams identifies as query params of List request
type ObjectsService ¶
type ObjectsService interface { List(context.Context, interface{}) ([]Object, *http.Response, error) Get(context.Context, string) (*Object, *http.Response, error) Create(context.Context, *ObjectCreateRequest) (*Object, *http.Response, error) Update(context.Context, string, *ObjectUpdateRequest) (*http.Response, error) Delete(context.Context, string) (*http.Response, error) }
ObjectsService implements interface with API /objects endpoint. See https://doc.platformcraft.ru/filespot/api/en/#objects
type Player ¶
type Player struct { ID string `json:"id"` Name string `json:"name"` Path string `json:"path"` IsDir bool `json:"is_dir"` Videos videos `json:"videos"` ScreenShotURL string `json:"screen_shot_url"` VastAdTagURL string `json:"vast_ad_tag_url"` CreateDate string `json:"create_date"` Href string `json:"href"` FrameTag string `json:"frame_tag"` Description string `json:"description"` Tags tags `json:"tags"` Geo Geo `json:"geo"` }
Player represents a platformcraft Player
type PlayerCreateRequest ¶
type PlayerCreateRequest struct { Name string `json:"name"` Folder string `json:"folder"` Videos videos `json:"videos"` ScreenShotID string `json:"screen_shot_id"` VastAdTagURL string `json:"vast_ad_tag_url"` Description string `json:"description"` Tags tags `json:"tags"` Geo Geo `json:"geo"` }
PlayerCreateRequest identifies Player for the Create request
type PlayerUpdateRequest ¶
type PlayerUpdateRequest struct { Name string `json:"name"` Folder string `json:"folder"` Videos videos `json:"videos"` ScreenShotID string `json:"screen_shot_id"` Description string `json:"description"` Tags tags `json:"tags"` Geo Geo `json:"geo"` }
PlayerUpdateRequest indentifies Player for the Update request
type PlayersCli ¶
type PlayersCli struct {
// contains filtered or unexported fields
}
PlayersCli handles communication with API
func (PlayersCli) Create ¶
func (c PlayersCli) Create(ctx context.Context, playerCreateRequest *PlayerCreateRequest) (*Player, *http.Response, error)
Create Player
func (PlayersCli) Update ¶
func (c PlayersCli) Update(ctx context.Context, id string, playerUpdateRequest *PlayerUpdateRequest) (*http.Response, error)
Update Player
type PlayersService ¶
type PlayersService interface { List(context.Context, interface{}) ([]Player, *http.Response, error) Get(context.Context, string) (*Player, *http.Response, error) Create(context.Context, *PlayerCreateRequest) (*Player, *http.Response, error) Update(context.Context, string, *PlayerUpdateRequest) (*http.Response, error) Delete(context.Context, string) (*http.Response, error) }
PlayersService implements interface with API /players endpoint. See https://doc.platformcraft.ru/filespot/api/en/#players
type Preset ¶
type Preset struct { ID string `json:"id"` Name string `json:"name"` Container string `json:"container"` Video map[string]string `json:"video"` Audio map[string]string `json:"audio"` Watermarks map[string]watermarkParams `json:"watermarks"` }
Preset represents a platformcraft Preset
type SecureLink ¶
SecureLink represents a platformcraft Secure Link
type SecureLinkRequest ¶
SecureLinkRequest identifies data for Secure request
type StorageCli ¶
type StorageCli struct {
// contains filtered or unexported fields
}
StorageCli handles communication with API
type StorageService ¶
StorageService implements interface with API /storage endpoint. See https://doc.platformcraft.ru/filespot/api/en/#storage
type Stream ¶
type Stream struct { ID string `json:"id"` User string `json:"user"` Name string `json:"name"` URL string `json:"url"` IsInstantRecording bool `json:"is_instant_recording"` }
Stream represents a platformcraft Stream
type StreamCreateRequest ¶
StreamCreateRequest identifies Stream for the Create request
type StreamStartRequest ¶
type StreamStartRequest struct {
StopTimeout int `json:"stop_timeout"`
}
StreamStartRequest identifies streaming process for the Start request
type StreamsCli ¶
type StreamsCli struct {
// contains filtered or unexported fields
}
StreamsCli handles communication with API
func (StreamsCli) Create ¶
func (c StreamsCli) Create(ctx context.Context, streamCreateRequest *StreamCreateRequest) (*Stream, *http.Response, error)
Create Stream
func (StreamsCli) CreateSchedule ¶
CreateSchedule returns record_id
func (StreamsCli) DeleteSchedule ¶
func (c StreamsCli) DeleteSchedule(ctx context.Context, streamID string, recordID string) (*http.Response, error)
DeleteSchedule deletes record
func (StreamsCli) Start ¶
func (c StreamsCli) Start(ctx context.Context, id string, streamStartRequest *StreamStartRequest) (*http.Response, error)
Start Stream
type StreamsService ¶
type StreamsService interface { List(context.Context) ([]Stream, *http.Response, error) Get(context.Context, string) (*Stream, *http.Response, error) Create(context.Context, *StreamCreateRequest) (*Stream, *http.Response, error) Delete(context.Context, string) (*http.Response, error) Start(context.Context, string, *StreamStartRequest) (*http.Response, error) Stop(context.Context, string) ([]File, *http.Response, error) CreateSchedule(context.Context, string) (string, *http.Response, error) Rec(context.Context, string) (*Record, *http.Response, error) DeleteSchedule(context.Context, string, string) (*http.Response, error) }
StreamsService implements interface with API /streams endpoint. See https://doc.platformcraft.ru/filespot/api/en/#streams
type Task ¶
type Task struct { ID string `json:"id"` Category string `json:"category"` Title string `json:"title"` Body string `json:"body"` Status string `json:"status"` TimeStart string `json:"time_start"` TimeFinish string `json:"time_finish"` Lock bool `json:"lock"` }
Task represents a platformcraft Task
type TempCli ¶
type TempCli struct {
// contains filtered or unexported fields
}
TempCli handles communication with API
func (TempCli) Create ¶
func (c TempCli) Create(ctx context.Context, linkCreateRequest *LinkCreateRequest) (*Link, *http.Response, error)
Create Link
type TempListParams ¶
type TempListParams struct { ObjectID string `url:"object_id,omitempty"` ForSale bool `json:"for_sale,omitempty"` Secure bool `json:"secure,omitempty"` }
TempListParams identifies as query params of List request
type TempService ¶
type TempService interface { List(context.Context, interface{}) ([]Link, *http.Response, error) Get(context.Context, string) (*Link, *http.Response, error) Create(context.Context, *LinkCreateRequest) (*Link, *http.Response, error) Delete(context.Context, string) (*http.Response, error) Secure(context.Context, string, *SecureLinkRequest) (*SecureLink, *http.Response, error) }
TempService implements interface with API /temp endpoint. See https://doc.platformcraft.ru/filespot/api/en/#temp
type Transcoder ¶
Transcoder represents a platformcraft Transcoder
type TranscoderCli ¶
type TranscoderCli struct {
// contains filtered or unexported fields
}
TranscoderCli handles communication with API
func (TranscoderCli) Concat ¶
func (c TranscoderCli) Concat(ctx context.Context, transcoderConcatRequest *TranscoderConcatRequest) (*Transcoder, *http.Response, error)
Concat Transcoder
func (TranscoderCli) Create ¶
func (c TranscoderCli) Create(ctx context.Context, id string, transcoderCreateRequest *TranscoderCreateRequest) (*Transcoder, *http.Response, error)
Create Transcoder
func (TranscoderCli) HLS ¶
func (c TranscoderCli) HLS(ctx context.Context, id string, transcoderHLSRequest *TranscoderHLSRequest) (*Transcoder, *http.Response, error)
HLS Transcoder
type TranscoderConcatRequest ¶
type TranscoderConcatRequest struct { Files []string `json:"files"` Path string `json:"path"` Name string `json:"name"` }
TranscoderConcatRequest identifies params for the Concat request
type TranscoderCreateRequest ¶
type TranscoderCreateRequest struct { Presets []string `json:"presets"` Path string `json:"path"` Watermarks watermark `json:"watermarks"` DelOriginal bool `json:"del_original"` Start int `json:"start"` Duration int `json:"duration"` }
TranscoderCreateRequest identifies params for the Create request
type TranscoderHLSRequest ¶
type TranscoderHLSRequest struct { Presets []string `json:"presets"` SegmentDuration int `json:"segment_duration"` }
TranscoderHLSRequest identifies params for the HLS request
type TranscoderService ¶
type TranscoderService interface { Presets(context.Context) ([]Preset, *http.Response, error) Create(context.Context, string, *TranscoderCreateRequest) (*Transcoder, *http.Response, error) Concat(context.Context, *TranscoderConcatRequest) (*Transcoder, *http.Response, error) HLS(context.Context, string, *TranscoderHLSRequest) (*Transcoder, *http.Response, error) }
TranscoderService implements interface with API /transcoder endpoint. See https://doc.platformcraft.ru/filespot/api/en/#transcoder
type TranscoderTasksCli ¶
type TranscoderTasksCli struct {
// contains filtered or unexported fields
}
TranscoderTasksCli handles communication with API
type TranscoderTasksService ¶
type TranscoderTasksService interface { List(context.Context) ([]Task, *http.Response, error) Get(context.Context, string) (*Task, *http.Response, error) HLS(context.Context, string) (*Task, *http.Response, error) Delete(context.Context, string) (*http.Response, error) }
TranscoderTasksService implements interface with API /transcoder_tasks endpoint. See https://doc.platformcraft.ru/filespot/api/en/#transcoder_tasks