Documentation
¶
Overview ¶
Package client provides types and methods for interacting with the Snickers API.
Index ¶
- type APIError
- type AudioPreset
- type Client
- func (c *Client) CreateJob(jobInput JobInput) (*Job, error)
- func (c *Client) CreatePreset(preset Preset) (*Preset, error)
- func (c *Client) DeletePreset(presetName string) error
- func (c *Client) GetJob(jobID string) (*Job, error)
- func (c *Client) GetJobs() ([]Job, error)
- func (c *Client) GetPreset(presetName string) (*Preset, error)
- func (c *Client) GetPresets() ([]Preset, error)
- func (c *Client) StartJob(jobID string) (*Job, error)
- type Job
- type JobInput
- type JobStatus
- type Preset
- type VideoPreset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
Status int `json:"status,omitempty"`
Errors string `json:"errors,omitempty"`
}
APIError represents an error returned by the Snickers API.
type AudioPreset ¶
type AudioPreset struct {
Codec string `json:"codec,omitempty"`
Bitrate string `json:"bitrate,omitempty"`
}
AudioPreset define the set of parameters for audio on a given preset
type Client ¶
type Client struct {
Endpoint string
}
Client is the basic type for interacting with the API. It provides methods matching the available actions in the API.
func NewClient ¶
NewClient creates a instance of the client type.
func (*Client) CreateJob ¶
CreateJob sends a single job and send it for processing
func (*Client) CreatePreset ¶
CreatePreset creates a new preset
func (*Client) DeletePreset ¶
DeletePreset removes a preset based on its preset name
func (*Client) GetJob ¶
GetJob returns metadata on a single job
func (*Client) GetPreset ¶
GetPreset return details of a given preset name
func (*Client) GetPresets ¶
GetPresets returns a list of presets
type Job ¶
type Job struct {
ID string `json:"id"`
Source string `json:"source"`
Destination string `json:"destination"`
Preset Preset `json:"preset"`
Status JobStatus `json:"status"`
Details string `json:"progress"`
LocalSource string `json:"-"`
LocalDestination string `json:"-"`
}
Job is the set of parameters of a given job
type JobInput ¶
type JobInput struct {
Source string `json:"source"`
Destination string `json:"destination"`
PresetName string `json:"preset"`
}
JobInput stores the information passed from the user when creating a job.
type Preset ¶
type Preset struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Container string `json:"container,omitempty"`
RateControl string `json:"rateControl,omitempty"`
Video VideoPreset `json:"video"`
Audio AudioPreset `json:"audio"`
}
Preset define the set of parameters of a given preset
type VideoPreset ¶
type VideoPreset struct {
Width string `json:"width,omitempty"`
Height string `json:"height,omitempty"`
Codec string `json:"codec,omitempty"`
Bitrate string `json:"bitrate,omitempty"`
GopSize string `json:"gopSize,omitempty"`
GopMode string `json:"gopMode,omitempty"`
Profile string `json:"profile,omitempty"`
ProfileLevel string `json:"profileLevel,omitempty"`
InterlaceMode string `json:"interlaceMode,omitempty"`
}
VideoPreset define the set of parameters for video on a given preset
Source Files
¶
- client.go
- job.go
- preset.go