Documentation
¶
Index ¶
- Variables
- type API
- type APIInterface
- type AssetPayload
- type AudioTarget
- type Client
- func (c *Client) CallAPI(method string, apiPath string, params url.Values, body io.Reader) (string, error)
- func (c *Client) CreatePreset(preset Preset) (Preset, error)
- func (c *Client) DeletePreset(presetID string) error
- func (c *Client) GetJobInfo(jobID string) (JobInfo, error)
- func (c *Client) GetPreset(presetID string) (Preset, error)
- func (c *Client) QueueJob(jobJSON string) (string, error)
- func (c *Client) StopJob(jobID string) error
- type ClientInterface
- type Config
- type Connection
- type ConnectionFrom
- type ConnectionTo
- type CreateJob
- type CreateJobPayload
- type Element
- type ElementPayload
- type ElementTaskOptions
- type ErrCreatePreset
- type ErrGetPreset
- type ErrNotDeleted
- type JobInfo
- type LocationTargetPayload
- type ManifestCreatorPayload
- type Preset
- type PresetList
- type PresetPayload
- type PresetTarget
- type ToError
- type ToSuccess
- type TranscodeContainer
- type TranscodeLocation
- type TranscodeLocationTarget
- type TranscodePreset
- type TranscodeTarget
- type TranscodeTargetContainer
- type VideoTarget
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoOAPIKey is the error for zero value config OAPIKey ErrNoOAPIKey = errors.New("no oapi key provided") // ErrNoOAPISecret is the error for zero value config OAPISecret ErrNoOAPISecret = errors.New("no oapi secret provided") // ErrNoAuthKey is the error for zero value config AuthKey ErrNoAuthKey = errors.New("no auth key provided") // ErrNoAuthSecret is the error for zero value config AuthSecret ErrNoAuthSecret = errors.New("no auth secret provided") // ErrNoAPIURL is the error for zero value config API URL ErrNoAPIURL = errors.New("no api url provided") // ErrNoComplianceDate is the error for zero value config ComplianceDate ErrNoComplianceDate = errors.New("no compliance date provided") // ErrInvalidComplianceDate is the error for an invalid compliance date provided ErrInvalidComplianceDate = errors.New("provided compliance date is invalid. Expected format: 'YYYYMMDD'") // ErrInvalidURL is the error for an invalid URL provided ErrInvalidURL = errors.New("invalid api url provided") )
var ( // ErrGopSizeNan is an error returned when the GopSize field of db.Preset is not a valid number ErrGopSizeNan = fmt.Errorf("bitrate non a number") )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Config Config
// contains filtered or unexported fields
}
API is the implementation of the HybrikAPI methods
type APIInterface ¶
type APIInterface interface {
CallAPI(method string, apiPath string, params url.Values, body io.Reader) (string, error)
// contains filtered or unexported methods
}
APIInterface is interface for the underlying client object
type AssetPayload ¶
type AssetPayload struct {
StorageProvider string `json:"storage_provider,omitempty"`
URL string `json:"url,omitempty"`
}
AssetPayload .
type AudioTarget ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the ClientInterface
func (*Client) CallAPI ¶
func (c *Client) CallAPI(method string, apiPath string, params url.Values, body io.Reader) (string, error)
CallAPI can be used to make any GET/POST/PUT/DELETE API call to the Hybrik service
func (*Client) CreatePreset ¶
CreatePreset creates a new preset
func (*Client) DeletePreset ¶
DeletePreset removes a preset based on its presetID
func (*Client) GetJobInfo ¶
GetJobInfo takes a jobID and obtains basic status details about the corresponding job
type ClientInterface ¶
type ClientInterface interface {
// Generic
CallAPI(method string, apiPath string, params url.Values, body io.Reader) (string, error)
// Jobs API
QueueJob(string) (string, error)
GetJobInfo(string) (JobInfo, error)
StopJob(string) error
// Presets API
GetPreset(string) (Preset, error)
CreatePreset(Preset) (Preset, error)
DeletePreset(string) error
}
ClientInterface is an interface for commonly used API calls
type Config ¶
type Config struct {
URL string
ComplianceDate string
OAPIKey string
OAPISecret string
AuthKey string
AuthSecret string
OAPIURL string
}
Config represents the configuration params that are necessary for the API calls to Hybrik to work
type Connection ¶
type Connection struct {
From []ConnectionFrom `json:"from,omitempty"`
To ConnectionTo `json:"to,omitempty"`
}
Connection .
type ConnectionFrom ¶
type ConnectionFrom struct {
Element string `json:"element,omitempty"`
}
ConnectionFrom .
type ConnectionTo ¶
type ConnectionTo struct {
Success []ToSuccess `json:"success,omitempty"`
Error []ToError `json:"error,omitempty"`
}
ConnectionTo .
type CreateJob ¶
type CreateJob struct {
Name string `json:"name"`
Payload CreateJobPayload `json:"payload"`
Schema string `json:"schema,omitempty"`
Expiration int `json:"expiration,omitempty"`
Priority int `json:"priority,omitempty"`
TaskRetryCount int `json:"task_retry:count,omitempty"`
TaskRetryDelaySec int `json:"task_retry:delay_sec,omitempty"`
TaskTags []string `json:"task_tags,omitempty"`
UserTag string `json:"user_tag,omitempty"`
}
CreateJob .
type CreateJobPayload ¶
type CreateJobPayload struct {
Elements []Element `json:"elements,omitempty"`
Connections []Connection `json:"connections,omitempty"`
}
CreateJobPayload .
type Element ¶
type Element struct {
UID string `json:"uid"`
Kind string `json:"kind"`
Task *ElementTaskOptions `json:"task,omitempty"`
Preset *TranscodePreset `json:"preset,omitempty"`
Payload interface{} `json:"payload"` // Can be of type ElementPayload or LocationTargetPayload
}
Element .
type ElementPayload ¶
type ElementPayload struct {
Kind string `json:"kind,omitempty"`
Payload AssetPayload `json:"payload"`
}
ElementPayload .
type ElementTaskOptions ¶
type ElementTaskOptions struct {
Name string `json:"name"`
}
ElementTaskOptions .
type ErrCreatePreset ¶
type ErrCreatePreset struct {
Msg string
}
ErrCreatePreset occurs when there is a problem creating a preset
func (ErrCreatePreset) Error ¶
func (e ErrCreatePreset) Error() string
type ErrGetPreset ¶
type ErrGetPreset struct {
Msg string
}
ErrGetPreset occurs when there is a problem obtaining a preset
func (ErrGetPreset) Error ¶
func (e ErrGetPreset) Error() string
type ErrNotDeleted ¶
type ErrNotDeleted struct {
JobID string
}
ErrNotDeleted is the error returned when a job is not successfully deleted from Hybrik
func (ErrNotDeleted) Error ¶
func (e ErrNotDeleted) Error() string
type JobInfo ¶
type JobInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Progress int `json:"progress"`
}
JobInfo is the GetJobInfo response containing basic details about a job
type LocationTargetPayload ¶
type LocationTargetPayload struct {
Location TranscodeLocation `json:"location"`
Targets []TranscodeLocationTarget `json:"targets"`
}
LocationTargetPayload .
type ManifestCreatorPayload ¶
type ManifestCreatorPayload struct {
Location TranscodeLocation `json:"location"`
FilePattern string `json:"file_pattern"`
Kind string `json:"kind"`
UID string `json:"uid,omitempty"`
}
ManifestCreatorPayload .
type Preset ¶
type Preset struct {
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description"`
UserData string `json:"user_data,omitempty"`
Kind string `json:"kind"`
Path string `json:"path"`
Payload PresetPayload `json:"payload"`
}
Preset represents a transcoding preset
type PresetList ¶
type PresetList []Preset
PresetList represents the response returned by a query for the list of jobs
type PresetPayload ¶
type PresetPayload struct {
Targets []PresetTarget `json:"targets"`
}
type PresetTarget ¶
type PresetTarget struct {
FilePattern string `json:"file_pattern"`
Container struct {
Kind string `json:"kind"`
} `json:"container"`
Video VideoTarget `json:"video,omitempty"`
Audio []AudioTarget `json:"audio,omitempty"`
ExistingFiles string `json:"existing_files,omitempty"`
UID string `json:"uid,omitempty"`
}
type TranscodeContainer ¶
type TranscodeContainer struct {
Kind string `json:"kind"`
}
TranscodeContainer .
type TranscodeLocation ¶
type TranscodeLocation struct {
StorageProvider string `json:"storage_provider,omitempty"`
Path string `json:"path,omitempty"`
}
TranscodeLocation .
type TranscodeLocationTarget ¶
type TranscodeLocationTarget struct {
FilePattern string `json:"file_pattern"`
ExistingFiles string `json:"existing_files,omitempty"`
Container TranscodeTargetContainer `json:"container,omitempty"`
Location *TranscodeLocation `json:"location,omitempty"`
}
TranscodeLocationTarget .
type TranscodeTarget ¶
type TranscodeTarget struct {
FilePattern string `json:"file_pattern"`
ExistingFiles string `json:"existing_files"`
Container TranscodeContainer `json:"container"`
Video map[string]interface{} `json:"video"`
Audio []map[string]interface{} `json:"audio"`
}
TranscodeTarget .
type TranscodeTargetContainer ¶
type TranscodeTargetContainer struct {
SegmentDuration uint `json:"segment_duration,omitempty"`
}
TranscodeTargetContainer .
type VideoTarget ¶
type VideoTarget struct {
Width *int `json:"width,omitempty"`
Height *int `json:"height,omitempty"`
BitrateMode string `json:"bitrate_mode,omitempty"`
BitrateKb int `json:"bitrate_kb,omitempty"`
MaxBitrateKb int `json:"max_bitrate_kb,omitempty"`
VbvBufferSizeKb int `json:"vbv_buffer_size_kb,omitempty"`
FrameRate int `json:"frame_rate,omitempty"`
Codec string `json:"codec,omitempty"`
Profile string `json:"profile,omitempty"`
Level string `json:"level,omitempty"`
MinGOPFrames int `json:"min_gop_frames,omitempty"`
MaxGOPFrames int `json:"max_gop_frames,omitempty"`
UseClosedGOP bool `json:"use_closed_gop,omitempty"`
InterlaceMode string `json:"interlace_mode,omitempty"`
}