Documentation ¶
Index ¶
- type Callback
- type CallbackData
- type CaptionsService
- func (s *CaptionsService) AddProvider(provider providers.Provider)
- func (s *CaptionsService) CancelJob(r *http.Request) (int, interface{}, error)
- func (s *CaptionsService) CreateJob(r *http.Request) (int, interface{}, error)
- func (s *CaptionsService) DownloadCaption(w http.ResponseWriter, r *http.Request)
- func (s *CaptionsService) Endpoints() map[string]map[string]http.HandlerFunc
- func (s *CaptionsService) GetJob(r *http.Request) (int, interface{}, error)
- func (s *CaptionsService) GetJobs(r *http.Request) (int, interface{}, error)
- func (s *CaptionsService) GetTranscript(w http.ResponseWriter, r *http.Request)
- func (s *CaptionsService) Middleware(h http.Handler) http.Handler
- func (s *CaptionsService) Prefix() string
- func (s *CaptionsService) ProcessCallback(r *http.Request) (int, interface{}, error)
- type Client
- func (c Client) CancelJob(jobID string) (bool, error)
- func (c Client) DispatchJob(job *database.Job) error
- func (c Client) DownloadCaption(jobID string, captionType string) ([]byte, error)
- func (c Client) GenerateTranscript(captionFile []byte, captionFormat string) (string, error)
- func (c Client) GetJob(jobID string) (*database.Job, error)
- func (c Client) GetJobs(parentID string) ([]*database.JobSummary, error)
- func (c Client) ProcessCallback(callbackData CallbackData, jobID string) error
- type GCSStorage
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback struct { Code int `json:"code"` Data CallbackData `json:"data"` }
type CallbackData ¶
type CallbackData struct { Cancellable bool `json:"cancellable"` Default bool `json:"default"` ID int `json:"id"` BatchID int `json:"batch_id"` LanguageID int `json:"language_id"` MediaFileID int `json:"media_file_id"` LanguageIDs []int `json:"language_ids"` CancellationDetails string `json:"cancellation_details"` CancellationReason string `json:"cancellation_reason"` ReferenceID string `json:"reference_id"` Status string `json:"status"` Type string `json:"type"` Duration float64 `json:"duration"` }
type CaptionsService ¶
type CaptionsService struct {
// contains filtered or unexported fields
}
CaptionsService the service responsible to wrapping interactions with Providers
func NewCaptionsService ¶
func NewCaptionsService(cfg *config.CaptionsServiceConfig, db database.DB) *CaptionsService
NewCaptionsService creates a CaptionsService
func (*CaptionsService) AddProvider ¶
func (s *CaptionsService) AddProvider(provider providers.Provider)
AddProvider adds a Provider to the CaptionsService
func (*CaptionsService) CancelJob ¶
func (s *CaptionsService) CancelJob(r *http.Request) (int, interface{}, error)
CancelJob cancels a given Job by its ID
func (*CaptionsService) CreateJob ¶
func (s *CaptionsService) CreateJob(r *http.Request) (int, interface{}, error)
CreateJob create a Job
func (*CaptionsService) DownloadCaption ¶
func (s *CaptionsService) DownloadCaption(w http.ResponseWriter, r *http.Request)
DownloadCaption downloads a caption in the specified format
func (*CaptionsService) Endpoints ¶
func (s *CaptionsService) Endpoints() map[string]map[string]http.HandlerFunc
Endpoints returns CaptionsService API endpoints
func (*CaptionsService) GetJob ¶
func (s *CaptionsService) GetJob(r *http.Request) (int, interface{}, error)
GetJob returns a Job given its ID
func (*CaptionsService) GetJobs ¶
func (s *CaptionsService) GetJobs(r *http.Request) (int, interface{}, error)
GetJobs returns all the Jobs associated with a ParentID
func (*CaptionsService) GetTranscript ¶
func (s *CaptionsService) GetTranscript(w http.ResponseWriter, r *http.Request)
GetTranscript returns a transcript of a given caption job
func (*CaptionsService) Middleware ¶
func (s *CaptionsService) Middleware(h http.Handler) http.Handler
Middleware gizmo middleware hook
func (*CaptionsService) Prefix ¶
func (s *CaptionsService) Prefix() string
Prefix CaptionsService API prefix
func (*CaptionsService) ProcessCallback ¶
func (s *CaptionsService) ProcessCallback(r *http.Request) (int, interface{}, error)
type Client ¶
type Client struct { Providers map[string]providers.Provider DB database.DB Logger *log.Logger Storage Storage CallbackURL string CallbackAPIKey string }
Client CaptionsService client
func (Client) DispatchJob ¶
DispatchJob dispatches a Job given an existing Provider
func (Client) DownloadCaption ¶
DownloadCaption downloads a caption of a given job in the specified format
func (Client) GenerateTranscript ¶
GenerateTranscript generates a transcript from the provided caption file and format
func (Client) GetJobs ¶
func (c Client) GetJobs(parentID string) ([]*database.JobSummary, error)
GetJobs gets all jobs associated with a ParentID
func (Client) ProcessCallback ¶
func (c Client) ProcessCallback(callbackData CallbackData, jobID string) error
type GCSStorage ¶
type GCSStorage struct {
// contains filtered or unexported fields
}
GCSStorage implements the Storage interface and stores files on GCS