Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIv1 ¶
type APIv1 struct {
Dir string
RunnerName string
ControllerIP string
// contains filtered or unexported fields
}
APIv1 is a struct which implements the runner.Communicator interface using HTTP.
func NewAPIv1 ¶
NewAPIv1 returns an instantiated ApiV1 struct after creating a proper temporary directory inside of the provided tempDir argument. tempDir will almost always be the result of os.TempDir().
func (*APIv1) SendJobComplete ¶
func (a *APIv1) SendJobComplete(ctx *context.Context, ji runner.JobInfo, cmdR runner.CommandResults) error
SendJobComplete lets the Controller know that the job was completed and sends the resulting file if there is one.
func (*APIv1) SendNewJobRequest ¶
SendNewJobRequest requests a new job from the Controller and downloads the file to be worked on. This method blocks the thread until a job is assigned to this Runner.
type AudioTrack ¶
AudioTrack contains information about a singular audio stream in a media file.
type CurrentTimer ¶
CurrentTimer is an interface for abstracting time.Now away from the code for testing purposes.
type FSer ¶
FSer is a mock interface for the ApiV1 struct which allows file system operations to be mocked out during testing.
type FileMetadata ¶
type FileMetadata struct {
General General `json:"general"`
VideoTracks []VideoTrack `json:"video_tracks"`
AudioTracks []AudioTrack `json:"audio_tracks"`
SubtitleTracks []SubtitleTrack `json:"subtitle_tracks"`
}
FileMetadata contains information about a video file.
type Filer ¶
Filer is a mock interface for the ApiV1 struct which allows reading, writing, closing, and naming of a file.
type General ¶
type General struct {
Duration float32 `json:"duration"`
}
General contains the general information about a media file.
type OsFS ¶
type OsFS struct{}
OsFS is FSer that uses the os package to fulfill the interface requirements.
type RequestDoer ¶
RequestDoer is a mock interface for the ApiV1 which allows for mock http Client's to be inserted during testing.
type SubtitleTrack ¶
SubtitleTrack contains information about a singular text stream in a media file.
type VideoTrack ¶
type VideoTrack struct {
Index int `json:"index"`
Codec string `json:"codec"`
Bitrate int `json:"bitrate"`
Width int `json:"width"`
Height int `json:"height"`
ColorPrimaries string `json:"color_primaries"`
}
VideoTrack contains information about a singular video stream in a media file.