Documentation ¶
Overview ¶
shottower Copyright (C) 2022 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
shottower Copyright (C) 2022 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
shottower Copyright (C) 2022 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
shottower Copyright (C) 2022 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func AssertAssetRenderResponseRequired(obj AssetRenderResponse) error
- func AssertAssetRequired(obj *Asset) error
- func AssertAssetResponseAttributesRequired(obj AssetResponseAttributes) error
- func AssertAssetResponseDataRequired(obj AssetResponseData) error
- func AssertAssetResponseRequired(obj AssetResponse) error
- func AssertAudioAssetRequired(obj AudioAsset) error
- func AssertClipRequired(obj *Clip) error
- func AssertCropRequired(obj *Crop) error
- func AssertDestinationsRequired(obj *Destinations) error
- func AssertEditRequired(obj *Edit) error
- func AssertFlipTransformationRequired(obj FlipTransformation) error
- func AssertFontRequired(obj *Font) error
- func AssertHTMLAssetRequired(obj HTMLAsset) error
- func AssertImageAssetRequired(obj ImageAsset) error
- func AssertLumaAssetRequired(obj LumaAsset) error
- func AssertMergeFieldRequired(obj *MergeField) error
- func AssertMuxDestinationOptionsRequired(obj MuxDestinationOptions) error
- func AssertMuxDestinationRequired(obj MuxDestination) error
- func AssertOffsetRequired(obj *Offset) error
- func AssertOutputRequired(obj *Output) error
- func AssertPosterRequired(obj *Poster) error
- func AssertProbeResponseRequired(obj ProbeResponse) error
- func AssertQueuedResponseDataRequired(obj QueuedResponseData) error
- func AssertQueuedResponseRequired(obj QueuedResponse) error
- func AssertRangeRequired(obj *Range) error
- func AssertRecurseAssetRenderResponseRequired(objSlice interface{}) error
- func AssertRecurseAssetRequired(objSlice interface{}) error
- func AssertRecurseAssetResponseAttributesRequired(objSlice interface{}) error
- func AssertRecurseAssetResponseDataRequired(objSlice interface{}) error
- func AssertRecurseAssetResponseRequired(objSlice interface{}) error
- func AssertRecurseAudioAssetRequired(objSlice interface{}) error
- func AssertRecurseClipRequired(objSlice interface{}) error
- func AssertRecurseCropRequired(objSlice interface{}) error
- func AssertRecurseDestinationsRequired(objSlice interface{}) error
- func AssertRecurseEditRequired(objSlice interface{}) error
- func AssertRecurseFlipTransformationRequired(objSlice interface{}) error
- func AssertRecurseFontRequired(objSlice interface{}) error
- func AssertRecurseHTMLAssetRequired(objSlice interface{}) error
- func AssertRecurseImageAssetRequired(objSlice interface{}) error
- func AssertRecurseInterfaceRequired(obj interface{}, callback func(interface{}) error) error
- func AssertRecurseLumaAssetRequired(objSlice interface{}) error
- func AssertRecurseMergeFieldRequired(objSlice interface{}) error
- func AssertRecurseMuxDestinationOptionsRequired(objSlice interface{}) error
- func AssertRecurseMuxDestinationRequired(objSlice interface{}) error
- func AssertRecurseOffsetRequired(objSlice interface{}) error
- func AssertRecurseOutputRequired(objSlice interface{}) error
- func AssertRecursePosterRequired(objSlice interface{}) error
- func AssertRecurseProbeResponseRequired(objSlice interface{}) error
- func AssertRecurseQueuedResponseDataRequired(objSlice interface{}) error
- func AssertRecurseQueuedResponseRequired(objSlice interface{}) error
- func AssertRecurseRangeRequired(objSlice interface{}) error
- func AssertRecurseRenderResponseDataRequired(objSlice interface{}) error
- func AssertRecurseRenderResponseRequired(objSlice interface{}) error
- func AssertRecurseRotateTransformationRequired(objSlice interface{}) error
- func AssertRecurseShotstackDestinationRequired(objSlice interface{}) error
- func AssertRecurseSizeRequired(objSlice interface{}) error
- func AssertRecurseSkewTransformationRequired(objSlice interface{}) error
- func AssertRecurseSoundtrackRequired(objSlice interface{}) error
- func AssertRecurseSubtitleRequired(objSlice interface{}) error
- func AssertRecurseTemplateDataResponseDataRequired(objSlice interface{}) error
- func AssertRecurseTemplateDataResponseRequired(objSlice interface{}) error
- func AssertRecurseTemplateListResponseDataRequired(objSlice interface{}) error
- func AssertRecurseTemplateListResponseItemRequired(objSlice interface{}) error
- func AssertRecurseTemplateListResponseRequired(objSlice interface{}) error
- func AssertRecurseTemplateRenderRequired(objSlice interface{}) error
- func AssertRecurseTemplateRequired(objSlice interface{}) error
- func AssertRecurseTemplateResponseDataRequired(objSlice interface{}) error
- func AssertRecurseTemplateResponseRequired(objSlice interface{}) error
- func AssertRecurseThumbnailRequired(objSlice interface{}) error
- func AssertRecurseTimelineRequired(objSlice interface{}) error
- func AssertRecurseTitleAssetRequired(objSlice interface{}) error
- func AssertRecurseTrackRequired(objSlice interface{}) error
- func AssertRecurseTransformationRequired(objSlice interface{}) error
- func AssertRecurseTransitionRequired(objSlice interface{}) error
- func AssertRecurseValueRequired(value reflect.Value, callback func(interface{}) error) error
- func AssertRecurseVideoAssetRequired(objSlice interface{}) error
- func AssertRenderResponseDataRequired(obj RenderResponseData) error
- func AssertRenderResponseRequired(obj RenderResponse) error
- func AssertRotateTransformationRequired(obj RotateTransformation) error
- func AssertShotstackDestinationRequired(obj ShotstackDestination) error
- func AssertSizeRequired(obj *Size) error
- func AssertSkewTransformationRequired(obj SkewTransformation) error
- func AssertSoundtrackRequired(obj *Soundtrack) error
- func AssertSubtitleRequired(obj *Subtitle) error
- func AssertTemplateDataResponseDataRequired(obj TemplateDataResponseData) error
- func AssertTemplateDataResponseRequired(obj TemplateDataResponse) error
- func AssertTemplateListResponseDataRequired(obj TemplateListResponseData) error
- func AssertTemplateListResponseItemRequired(obj TemplateListResponseItem) error
- func AssertTemplateListResponseRequired(obj TemplateListResponse) error
- func AssertTemplateRenderRequired(obj TemplateRender) error
- func AssertTemplateRequired(obj Template) error
- func AssertTemplateResponseDataRequired(obj TemplateResponseData) error
- func AssertTemplateResponseRequired(obj TemplateResponse) error
- func AssertThumbnailRequired(obj *Thumbnail) error
- func AssertTimelineRequired(obj *Timeline) error
- func AssertTitleAssetRequired(obj TitleAsset) error
- func AssertTrackRequired(obj *Track) error
- func AssertTransformationRequired(obj *Transformation) error
- func AssertTransitionRequired(obj *Transition) error
- func AssertVideoAssetRequired(obj VideoAsset) error
- func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
- func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
- func IsZeroValue(val interface{}) bool
- func Logger(inner http.Handler, name string) http.Handler
- func NewRouter(routers ...Router) *mux.Router
- func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)
- func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)
- type Asset
- type AssetRenderResponse
- type AssetResponse
- type AssetResponseAttributes
- type AssetResponseData
- type AudioAsset
- type Clip
- type Crop
- type Destinations
- type DownloadAPIController
- type DownloadAPIOption
- type DownloadAPIRouter
- type DownloadAPIService
- type DownloadAPIServicer
- type Edit
- type EditAPIController
- func (c *EditAPIController) DeleteTemplate(w http.ResponseWriter, r *http.Request)
- func (c *EditAPIController) GetRender(w http.ResponseWriter, r *http.Request)
- func (c *EditAPIController) GetTemplate(w http.ResponseWriter, r *http.Request)
- func (c *EditAPIController) GetTemplates(w http.ResponseWriter, r *http.Request)
- func (c *EditAPIController) PostRender(w http.ResponseWriter, r *http.Request)
- func (c *EditAPIController) PostTemplate(w http.ResponseWriter, r *http.Request)
- func (c *EditAPIController) PostTemplateRender(w http.ResponseWriter, r *http.Request)
- func (c *EditAPIController) Probe(w http.ResponseWriter, r *http.Request)
- func (c *EditAPIController) PutTemplate(w http.ResponseWriter, r *http.Request)
- func (c *EditAPIController) Routes() Routes
- type EditAPIOption
- type EditAPIRouter
- type EditAPIService
- func (s *EditAPIService) DeleteTemplate(ctx context.Context, id string) (ImplResponse, error)
- func (s *EditAPIService) GetQueue() []*RenderQueue
- func (s *EditAPIService) GetQueuePending() []*RenderQueue
- func (s *EditAPIService) GetRender(ctx context.Context, id string, data bool, merged bool) (ImplResponse, error)
- func (s *EditAPIService) GetTemplate(ctx context.Context, id string) (ImplResponse, error)
- func (s *EditAPIService) GetTemplates(ctx context.Context) (ImplResponse, error)
- func (s *EditAPIService) PostRender(ctx context.Context, edit Edit) (ImplResponse, error)
- func (s *EditAPIService) PostTemplate(ctx context.Context, template Template) (ImplResponse, error)
- func (s *EditAPIService) PostTemplateRender(ctx context.Context, templateRender TemplateRender) (ImplResponse, error)
- func (s *EditAPIService) Probe(ctx context.Context, url string) (ImplResponse, error)
- func (s *EditAPIService) PutTemplate(ctx context.Context, id string, template Template) (ImplResponse, error)
- type EditAPIServicer
- type EnumError
- type ErrorHandler
- type FFMPEG
- func (s *FFMPEG) AddAudioClip(trackNumber int, params string) error
- func (s *FFMPEG) AddClip(trackNumber int, params string) error
- func (s *FFMPEG) AddDefaultParams() error
- func (s *FFMPEG) AddSource(fileName string) error
- func (s *FFMPEG) AddTrack(trackNumber int) error
- func (s *FFMPEG) ClipAudioDelay(sourceClip int, trackNumber int, clipNumber int, delay float32) string
- func (s *FFMPEG) ClipAudioMerge(sourceClip int, trackNumber int, clipNumber int, effects []string) string
- func (s *FFMPEG) ClipAudioTrim(sourceClip int, trackNumber int, clipNumber int, start float32, length float32) string
- func (s *FFMPEG) ClipAudioVolume(sourceClip int, trackNumber int, clipNumber int, volume float32) string
- func (s *FFMPEG) ClipFiller(trackNumber int, clipNumber int, start float32, length float32) string
- func (s *FFMPEG) ClipFillerOverlay(sourceClip int, trackNumber int, clipNumber int, position string) string
- func (s *FFMPEG) ClipImage(sourceClip int, trackNumber int, clipNumber int, start float32, length float32) string
- func (s *FFMPEG) ClipMerge(sourceClip int, trackNumber int, clipNumber int, effects []string) string
- func (s *FFMPEG) ClipRaw(sourceClip int, trackNumber int, clipNumber int) string
- func (s *FFMPEG) ClipResize(sourceClip int, trackNumber int, clipNumber int, scaleRatio float32) string
- func (s *FFMPEG) ClipSubtitleBurn(sourceClip int, trackNumber int, clipNumber int, index int) string
- func (s *FFMPEG) ClipTrim(sourceClip int, trackNumber int, clipNumber int, start float32, length float32) string
- func (s *FFMPEG) CloseTrack(trackNumber int) error
- func (s *FFMPEG) GenerateBackground() string
- func (s *FFMPEG) GenerateFiller(color string) string
- func (s *FFMPEG) GetDuration() float32
- func (s *FFMPEG) GetOutputName() string
- func (s *FFMPEG) GetResolution() string
- func (s *FFMPEG) SetDefaultBackground(color string) error
- func (s *FFMPEG) SetOutputFormat(format string) error
- func (s *FFMPEG) SetOutputFps(fps float32) error
- func (s *FFMPEG) SetOutputResolution(format string) error
- func (s *FFMPEG) SetOutputSize(width *int32, height *int32) error
- func (s *FFMPEG) ToFFMPEG(queue *RenderQueue) error
- func (s *FFMPEG) ToString() []string
- type FFMPEGCommand
- type FFMPEGSource
- type FFMPEGTrack
- type FlipTransformation
- type Font
- type HTMLAsset
- type ImageAsset
- type ImplResponse
- type LumaAsset
- type MergeField
- type MuxDestination
- type MuxDestinationOptions
- type Offset
- type Output
- type ParsingError
- type Poster
- type ProbeResponse
- type ProcessingQueue
- func (s *ProcessingQueue) DownloadFile(url string) (string, error)
- func (s *ProcessingQueue) ExecuteFFMpeg(params []string)
- func (s *ProcessingQueue) FetchAssets(queue *RenderQueue)
- func (s *ProcessingQueue) GenerateParameters(queue *RenderQueue) []string
- func (s *ProcessingQueue) ProcessQueue(editAPI EditAPIServicer)
- func (s *ProcessingQueue) StartProcessQueue(editAPI EditAPIServicer)
- type ProcessingQueuer
- type QueuedResponse
- type QueuedResponseData
- type Range
- type RenderQueue
- type RenderResponse
- type RenderResponseData
- type RenderResponseStatus
- type RequiredError
- type RotateTransformation
- type Route
- type Router
- type Routes
- type ServeAPIController
- type ServeAPIOption
- type ServeAPIRouter
- type ServeAPIService
- type ServeAPIServicer
- type ShotstackDestination
- type Size
- type SkewTransformation
- type Soundtrack
- type Subtitle
- type Template
- type TemplateDataResponse
- type TemplateDataResponseData
- type TemplateListResponse
- type TemplateListResponseData
- type TemplateListResponseItem
- type TemplateRender
- type TemplateResponse
- type TemplateResponseData
- type Thumbnail
- type Timeline
- type TitleAsset
- type Track
- type Transformation
- type Transition
- type VideoAsset
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTypeAssertionError is thrown when type an interface does not match the asserted type ErrTypeAssertionError = errors.New("unable to assert type") )
Functions ¶
func AssertAssetRenderResponseRequired ¶
func AssertAssetRenderResponseRequired(obj AssetRenderResponse) error
AssertAssetRenderResponseRequired checks if the required fields are not zero-ed
func AssertAssetRequired ¶
AssertAssetRequired checks if the required fields are not zero-ed
func AssertAssetResponseAttributesRequired ¶
func AssertAssetResponseAttributesRequired(obj AssetResponseAttributes) error
AssertAssetResponseAttributesRequired checks if the required fields are not zero-ed
func AssertAssetResponseDataRequired ¶
func AssertAssetResponseDataRequired(obj AssetResponseData) error
AssertAssetResponseDataRequired checks if the required fields are not zero-ed
func AssertAssetResponseRequired ¶
func AssertAssetResponseRequired(obj AssetResponse) error
AssertAssetResponseRequired checks if the required fields are not zero-ed
func AssertAudioAssetRequired ¶
func AssertAudioAssetRequired(obj AudioAsset) error
AssertAudioAssetRequired checks if the required fields are not zero-ed
func AssertClipRequired ¶
AssertClipRequired checks if the required fields are not zero-ed
func AssertCropRequired ¶
AssertCropRequired checks if the required fields are not zero-ed
func AssertDestinationsRequired ¶
func AssertDestinationsRequired(obj *Destinations) error
AssertDestinationsRequired checks if the required fields are not zero-ed
func AssertEditRequired ¶
AssertEditRequired checks if the required fields are not zero-ed
func AssertFlipTransformationRequired ¶
func AssertFlipTransformationRequired(obj FlipTransformation) error
AssertFlipTransformationRequired checks if the required fields are not zero-ed
func AssertFontRequired ¶
AssertFontRequired checks if the required fields are not zero-ed
func AssertHTMLAssetRequired ¶
AssertHTMLAssetRequired checks if the required fields are not zero-ed
func AssertImageAssetRequired ¶
func AssertImageAssetRequired(obj ImageAsset) error
AssertImageAssetRequired checks if the required fields are not zero-ed
func AssertLumaAssetRequired ¶
AssertLumaAssetRequired checks if the required fields are not zero-ed
func AssertMergeFieldRequired ¶
func AssertMergeFieldRequired(obj *MergeField) error
AssertMergeFieldRequired checks if the required fields are not zero-ed
func AssertMuxDestinationOptionsRequired ¶
func AssertMuxDestinationOptionsRequired(obj MuxDestinationOptions) error
AssertMuxDestinationOptionsRequired checks if the required fields are not zero-ed
func AssertMuxDestinationRequired ¶
func AssertMuxDestinationRequired(obj MuxDestination) error
AssertMuxDestinationRequired checks if the required fields are not zero-ed
func AssertOffsetRequired ¶
AssertOffsetRequired checks if the required fields are not zero-ed
func AssertOutputRequired ¶
AssertOutputRequired checks if the required fields are not zero-ed
func AssertPosterRequired ¶
AssertPosterRequired checks if the required fields are not zero-ed
func AssertProbeResponseRequired ¶
func AssertProbeResponseRequired(obj ProbeResponse) error
AssertProbeResponseRequired checks if the required fields are not zero-ed
func AssertQueuedResponseDataRequired ¶
func AssertQueuedResponseDataRequired(obj QueuedResponseData) error
AssertQueuedResponseDataRequired checks if the required fields are not zero-ed
func AssertQueuedResponseRequired ¶
func AssertQueuedResponseRequired(obj QueuedResponse) error
AssertQueuedResponseRequired checks if the required fields are not zero-ed
func AssertRangeRequired ¶
AssertRangeRequired checks if the required fields are not zero-ed
func AssertRecurseAssetRenderResponseRequired ¶
func AssertRecurseAssetRenderResponseRequired(objSlice interface{}) error
AssertRecurseAssetRenderResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of AssetRenderResponse (e.g. [][]AssetRenderResponse), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseAssetRequired ¶
func AssertRecurseAssetRequired(objSlice interface{}) error
AssertRecurseAssetRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Asset (e.g. [][]Asset), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseAssetResponseAttributesRequired ¶
func AssertRecurseAssetResponseAttributesRequired(objSlice interface{}) error
AssertRecurseAssetResponseAttributesRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of AssetResponseAttributes (e.g. [][]AssetResponseAttributes), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseAssetResponseDataRequired ¶
func AssertRecurseAssetResponseDataRequired(objSlice interface{}) error
AssertRecurseAssetResponseDataRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of AssetResponseData (e.g. [][]AssetResponseData), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseAssetResponseRequired ¶
func AssertRecurseAssetResponseRequired(objSlice interface{}) error
AssertRecurseAssetResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of AssetResponse (e.g. [][]AssetResponse), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseAudioAssetRequired ¶
func AssertRecurseAudioAssetRequired(objSlice interface{}) error
AssertRecurseAudioAssetRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of AudioAsset (e.g. [][]AudioAsset), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseClipRequired ¶
func AssertRecurseClipRequired(objSlice interface{}) error
AssertRecurseClipRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Clip (e.g. [][]Clip), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseCropRequired ¶
func AssertRecurseCropRequired(objSlice interface{}) error
AssertRecurseCropRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Crop (e.g. [][]Crop), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseDestinationsRequired ¶
func AssertRecurseDestinationsRequired(objSlice interface{}) error
AssertRecurseDestinationsRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Destinations (e.g. [][]Destinations), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseEditRequired ¶
func AssertRecurseEditRequired(objSlice interface{}) error
AssertRecurseEditRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Edit (e.g. [][]Edit), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseFlipTransformationRequired ¶
func AssertRecurseFlipTransformationRequired(objSlice interface{}) error
AssertRecurseFlipTransformationRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of FlipTransformation (e.g. [][]FlipTransformation), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseFontRequired ¶
func AssertRecurseFontRequired(objSlice interface{}) error
AssertRecurseFontRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Font (e.g. [][]Font), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseHTMLAssetRequired ¶
func AssertRecurseHTMLAssetRequired(objSlice interface{}) error
AssertRecurseHTMLAssetRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of HTMLAsset (e.g. [][]HTMLAsset), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseImageAssetRequired ¶
func AssertRecurseImageAssetRequired(objSlice interface{}) error
AssertRecurseImageAssetRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ImageAsset (e.g. [][]ImageAsset), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseInterfaceRequired ¶
AssertRecurseInterfaceRequired recursively checks each struct in a slice against the callback. This method traverse nested slices in a pre order fashion.
func AssertRecurseLumaAssetRequired ¶
func AssertRecurseLumaAssetRequired(objSlice interface{}) error
AssertRecurseLumaAssetRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of LumaAsset (e.g. [][]LumaAsset), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseMergeFieldRequired ¶
func AssertRecurseMergeFieldRequired(objSlice interface{}) error
AssertRecurseMergeFieldRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of MergeField (e.g. [][]MergeField), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseMuxDestinationOptionsRequired ¶
func AssertRecurseMuxDestinationOptionsRequired(objSlice interface{}) error
AssertRecurseMuxDestinationOptionsRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of MuxDestinationOptions (e.g. [][]MuxDestinationOptions), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseMuxDestinationRequired ¶
func AssertRecurseMuxDestinationRequired(objSlice interface{}) error
AssertRecurseMuxDestinationRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of MuxDestination (e.g. [][]MuxDestination), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseOffsetRequired ¶
func AssertRecurseOffsetRequired(objSlice interface{}) error
AssertRecurseOffsetRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Offset (e.g. [][]Offset), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseOutputRequired ¶
func AssertRecurseOutputRequired(objSlice interface{}) error
AssertRecurseOutputRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Output (e.g. [][]Output), otherwise ErrTypeAssertionError is thrown.
func AssertRecursePosterRequired ¶
func AssertRecursePosterRequired(objSlice interface{}) error
AssertRecursePosterRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Poster (e.g. [][]Poster), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseProbeResponseRequired ¶
func AssertRecurseProbeResponseRequired(objSlice interface{}) error
AssertRecurseProbeResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ProbeResponse (e.g. [][]ProbeResponse), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseQueuedResponseDataRequired ¶
func AssertRecurseQueuedResponseDataRequired(objSlice interface{}) error
AssertRecurseQueuedResponseDataRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of QueuedResponseData (e.g. [][]QueuedResponseData), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseQueuedResponseRequired ¶
func AssertRecurseQueuedResponseRequired(objSlice interface{}) error
AssertRecurseQueuedResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of QueuedResponse (e.g. [][]QueuedResponse), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseRangeRequired ¶
func AssertRecurseRangeRequired(objSlice interface{}) error
AssertRecurseRangeRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Range (e.g. [][]Range), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseRenderResponseDataRequired ¶
func AssertRecurseRenderResponseDataRequired(objSlice interface{}) error
AssertRecurseRenderResponseDataRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of RenderResponseData (e.g. [][]RenderResponseData), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseRenderResponseRequired ¶
func AssertRecurseRenderResponseRequired(objSlice interface{}) error
AssertRecurseRenderResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of RenderResponse (e.g. [][]RenderResponse), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseRotateTransformationRequired ¶
func AssertRecurseRotateTransformationRequired(objSlice interface{}) error
AssertRecurseRotateTransformationRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of RotateTransformation (e.g. [][]RotateTransformation), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseShotstackDestinationRequired ¶
func AssertRecurseShotstackDestinationRequired(objSlice interface{}) error
AssertRecurseShotstackDestinationRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ShotstackDestination (e.g. [][]ShotstackDestination), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseSizeRequired ¶
func AssertRecurseSizeRequired(objSlice interface{}) error
AssertRecurseSizeRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Size (e.g. [][]Size), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseSkewTransformationRequired ¶
func AssertRecurseSkewTransformationRequired(objSlice interface{}) error
AssertRecurseSkewTransformationRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of SkewTransformation (e.g. [][]SkewTransformation), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseSoundtrackRequired ¶
func AssertRecurseSoundtrackRequired(objSlice interface{}) error
AssertRecurseSoundtrackRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Soundtrack (e.g. [][]Soundtrack), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseSubtitleRequired ¶
func AssertRecurseSubtitleRequired(objSlice interface{}) error
AssertRecurseSubtitleRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Subtitle (e.g. [][]Subtitle), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTemplateDataResponseDataRequired ¶
func AssertRecurseTemplateDataResponseDataRequired(objSlice interface{}) error
AssertRecurseTemplateDataResponseDataRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TemplateDataResponseData (e.g. [][]TemplateDataResponseData), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTemplateDataResponseRequired ¶
func AssertRecurseTemplateDataResponseRequired(objSlice interface{}) error
AssertRecurseTemplateDataResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TemplateDataResponse (e.g. [][]TemplateDataResponse), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTemplateListResponseDataRequired ¶
func AssertRecurseTemplateListResponseDataRequired(objSlice interface{}) error
AssertRecurseTemplateListResponseDataRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TemplateListResponseData (e.g. [][]TemplateListResponseData), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTemplateListResponseItemRequired ¶
func AssertRecurseTemplateListResponseItemRequired(objSlice interface{}) error
AssertRecurseTemplateListResponseItemRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TemplateListResponseItem (e.g. [][]TemplateListResponseItem), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTemplateListResponseRequired ¶
func AssertRecurseTemplateListResponseRequired(objSlice interface{}) error
AssertRecurseTemplateListResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TemplateListResponse (e.g. [][]TemplateListResponse), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTemplateRenderRequired ¶
func AssertRecurseTemplateRenderRequired(objSlice interface{}) error
AssertRecurseTemplateRenderRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TemplateRender (e.g. [][]TemplateRender), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTemplateRequired ¶
func AssertRecurseTemplateRequired(objSlice interface{}) error
AssertRecurseTemplateRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Template (e.g. [][]Template), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTemplateResponseDataRequired ¶
func AssertRecurseTemplateResponseDataRequired(objSlice interface{}) error
AssertRecurseTemplateResponseDataRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TemplateResponseData (e.g. [][]TemplateResponseData), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTemplateResponseRequired ¶
func AssertRecurseTemplateResponseRequired(objSlice interface{}) error
AssertRecurseTemplateResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TemplateResponse (e.g. [][]TemplateResponse), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseThumbnailRequired ¶
func AssertRecurseThumbnailRequired(objSlice interface{}) error
AssertRecurseThumbnailRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Thumbnail (e.g. [][]Thumbnail), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTimelineRequired ¶
func AssertRecurseTimelineRequired(objSlice interface{}) error
AssertRecurseTimelineRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Timeline (e.g. [][]Timeline), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTitleAssetRequired ¶
func AssertRecurseTitleAssetRequired(objSlice interface{}) error
AssertRecurseTitleAssetRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TitleAsset (e.g. [][]TitleAsset), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTrackRequired ¶
func AssertRecurseTrackRequired(objSlice interface{}) error
AssertRecurseTrackRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Track (e.g. [][]Track), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTransformationRequired ¶
func AssertRecurseTransformationRequired(objSlice interface{}) error
AssertRecurseTransformationRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Transformation (e.g. [][]Transformation), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTransitionRequired ¶
func AssertRecurseTransitionRequired(objSlice interface{}) error
AssertRecurseTransitionRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Transition (e.g. [][]Transition), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseValueRequired ¶
AssertRecurseValueRequired checks each struct in the nested slice against the callback. This method traverse nested slices in a pre order fashion.
func AssertRecurseVideoAssetRequired ¶
func AssertRecurseVideoAssetRequired(objSlice interface{}) error
AssertRecurseVideoAssetRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of VideoAsset (e.g. [][]VideoAsset), otherwise ErrTypeAssertionError is thrown.
func AssertRenderResponseDataRequired ¶
func AssertRenderResponseDataRequired(obj RenderResponseData) error
AssertRenderResponseDataRequired checks if the required fields are not zero-ed
func AssertRenderResponseRequired ¶
func AssertRenderResponseRequired(obj RenderResponse) error
AssertRenderResponseRequired checks if the required fields are not zero-ed
func AssertRotateTransformationRequired ¶
func AssertRotateTransformationRequired(obj RotateTransformation) error
AssertRotateTransformationRequired checks if the required fields are not zero-ed
func AssertShotstackDestinationRequired ¶
func AssertShotstackDestinationRequired(obj ShotstackDestination) error
AssertShotstackDestinationRequired checks if the required fields are not zero-ed
func AssertSizeRequired ¶
AssertSizeRequired checks if the required fields are not zero-ed
func AssertSkewTransformationRequired ¶
func AssertSkewTransformationRequired(obj SkewTransformation) error
AssertSkewTransformationRequired checks if the required fields are not zero-ed
func AssertSoundtrackRequired ¶
func AssertSoundtrackRequired(obj *Soundtrack) error
AssertSoundtrackRequired checks if the required fields are not zero-ed
func AssertSubtitleRequired ¶
AssertSubtitleRequired checks if the required fields are not zero-ed
func AssertTemplateDataResponseDataRequired ¶
func AssertTemplateDataResponseDataRequired(obj TemplateDataResponseData) error
AssertTemplateDataResponseDataRequired checks if the required fields are not zero-ed
func AssertTemplateDataResponseRequired ¶
func AssertTemplateDataResponseRequired(obj TemplateDataResponse) error
AssertTemplateDataResponseRequired checks if the required fields are not zero-ed
func AssertTemplateListResponseDataRequired ¶
func AssertTemplateListResponseDataRequired(obj TemplateListResponseData) error
AssertTemplateListResponseDataRequired checks if the required fields are not zero-ed
func AssertTemplateListResponseItemRequired ¶
func AssertTemplateListResponseItemRequired(obj TemplateListResponseItem) error
AssertTemplateListResponseItemRequired checks if the required fields are not zero-ed
func AssertTemplateListResponseRequired ¶
func AssertTemplateListResponseRequired(obj TemplateListResponse) error
AssertTemplateListResponseRequired checks if the required fields are not zero-ed
func AssertTemplateRenderRequired ¶
func AssertTemplateRenderRequired(obj TemplateRender) error
AssertTemplateRenderRequired checks if the required fields are not zero-ed
func AssertTemplateRequired ¶
AssertTemplateRequired checks if the required fields are not zero-ed
func AssertTemplateResponseDataRequired ¶
func AssertTemplateResponseDataRequired(obj TemplateResponseData) error
AssertTemplateResponseDataRequired checks if the required fields are not zero-ed
func AssertTemplateResponseRequired ¶
func AssertTemplateResponseRequired(obj TemplateResponse) error
AssertTemplateResponseRequired checks if the required fields are not zero-ed
func AssertThumbnailRequired ¶
AssertThumbnailRequired checks if the required fields are not zero-ed
func AssertTimelineRequired ¶
AssertTimelineRequired checks if the required fields are not zero-ed
func AssertTitleAssetRequired ¶
func AssertTitleAssetRequired(obj TitleAsset) error
AssertTitleAssetRequired checks if the required fields are not zero-ed
func AssertTrackRequired ¶
AssertTrackRequired checks if the required fields are not zero-ed
func AssertTransformationRequired ¶
func AssertTransformationRequired(obj *Transformation) error
AssertTransformationRequired checks if the required fields are not zero-ed
func AssertTransitionRequired ¶
func AssertTransitionRequired(obj *Transition) error
AssertTransitionRequired checks if the required fields are not zero-ed
func AssertVideoAssetRequired ¶
func AssertVideoAssetRequired(obj VideoAsset) error
AssertVideoAssetRequired checks if the required fields are not zero-ed
func DefaultErrorHandler ¶
func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used.
func EncodeJSONResponse ¶
func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
func IsZeroValue ¶
func IsZeroValue(val interface{}) bool
IsZeroValue checks if the val is the zero-ed value.
func ReadFormFileToTempFile ¶
ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file
Types ¶
type Asset ¶
type Asset struct { // The type of asset - set to `luma` for luma mattes. Type string `json:"type"` // The luma matte source URL. The URL must be publicly accessible or include credentials. Src string `json:"src,omitempty"` // The start trim point of the luma matte clip, in seconds (defaults to 0). Videos will start from the in trim point. A luma matte video will play until the file ends or the Clip length is reached. Trim float32 `json:"trim,omitempty" default:"0"` // Set the volume for the audio clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1). Volume float32 `json:"volume,omitempty" default:"1"` Crop *Crop `json:"crop,omitempty"` // The title text string - i.e. \"My Title\". Text string `json:"text,omitempty"` // Uses a preset to apply font properties and styling to the title. <ul> <li>`minimal`</li> <li>`blockbuster`</li> <li>`vogue`</li> <li>`sketchy`</li> <li>`skinny`</li> <li>`chunk`</li> <li>`chunkLight`</li> <li>`marker`</li> <li>`future`</li> <li>`subtitle`</li> </ul> Style string `json:"style,omitempty"` // Set the text color using hexadecimal color notation. Transparency is supported by setting the first two characters of the hex string (opposite to HTML), i.e. #80ffffff will be white with 50% transparency. Color string `json:"color,omitempty"` // Set the relative size of the text using predefined sizes from xx-small to xx-large. <ul> <li>`xx-small`</li> <li>`x-small`</li> <li>`small`</li> <li>`medium`</li> <li>`large`</li> <li>`x-large`</li> <li>`xx-large`</li> </ul> Size string `json:"size,omitempty"` // Apply a background color behind the HTML bounding box using. Set the text color using hexadecimal color notation. Transparency is supported by setting the first two characters of the hex string (opposite to HTML), i.e. #80ffffff will be white with 50% transparency. Background string `json:"background,omitempty"` // Place the HTML in one of nine predefined positions within the HTML area. <ul> <li>`top` - top (center)</li> <li>`topRight` - top right</li> <li>`right` - right (center)</li> <li>`bottomRight` - bottom right</li> <li>`bottom` - bottom (center)</li> <li>`bottomLeft` - bottom left</li> <li>`left` - left (center)</li> <li>`topLeft` - top left</li> <li>`center` - center</li> </ul> Position string `json:"position,omitempty"` Offset *Offset `json:"offset,omitempty"` // The HTML text string. See list of [supported HTML tags](https://shotstack.io/docs/guide/architecting-an-application/html-support#supported-html-tags). HTML string `json:"html,omitempty"` // The CSS text string to apply styling to the HTML. See list of [support CSS properties](https://shotstack.io/docs/guide/architecting-an-application/html-support#supported-css-properties). CSS string `json:"css,omitempty"` // Set the width of the HTML asset bounding box in pixels. Text will wrap to fill the bounding box. Width int32 `json:"width,omitempty"` // Set the width of the HTML asset bounding box in pixels. Text and elements will be masked if they exceed the height of the bounding box. Height int32 `json:"height,omitempty"` // The effect to apply to the audio asset <ul> <li>`fadeIn` - fade volume in only</li> <li>`fadeOut` - fade volume out only</li> <li>`fadeInFadeOut` - fade volume in and out</li> </ul> Effect string `json:"effect,omitempty"` Subtitle *Subtitle `json:"subtitle,omitempty"` }
Asset - The type of asset to display for the duration of this Clip. Value must be one of: <ul> <li><a href=\"#tocs_videoasset\">VideoAsset</a></li> <li><a href=\"#tocs_imageasset\">ImageAsset</a></li> <li><a href=\"#tocs_titleasset\">TitleAsset</a></li> <li><a href=\"#tocs_HTMLAsset\">HTMLAsset</a></li> <li><a href=\"#tocs_audioasset\">AudioAsset</a></li> <li><a href=\"#tocs_lumaasset\">LumaAsset</a></li> </ul>
type AssetRenderResponse ¶
type AssetRenderResponse struct { // An array of asset resources grouped by render id. Data []AssetResponseData `json:"data"` }
AssetRenderResponse - The response returned by the Serve API [get asset by render id](#get-asset-by-render-id) request. The response is an array of asset resources, including video, image, audio, thumbnail and poster image. The response follows the [json:api](https://jsonapi.org/) specification.
type AssetResponse ¶
type AssetResponse struct {
Data AssetResponseData `json:"data"`
}
AssetResponse - The response returned by the Serve API [get asset](#get-asset) request. Includes details of a hosted video, image, audio file, thumbnail or poster image. The response follows the [json:api](https://jsonapi.org/) specification.
type AssetResponseAttributes ¶
type AssetResponseAttributes struct { // The unique id of the hosted asset in UUID format. ID string `json:"id"` // The owner id of the render task. Owner string `json:"owner"` // The region the asset is hosted, currently only `au` (Australia). Region string `json:"region,omitempty"` // The original render id that created the asset in UUID format. Multiple assets can share the same render id. RenderID string `json:"renderId,omitempty"` // The third party id of an asset transferred to an external provider, i.e. Mux, YouTube or S3. If the provider is Shotstack, the providerID is the same as the asset id. ProviderID string `json:"providerId,omitempty"` // The asset file name. Filename string `json:"filename"` // The asset file name. URL string `json:"url,omitempty"` // The status of the asset. <ul> <li>`importing` - the asset is being copied to the hosting service</li> <li>`ready` - the asset is ready to be served to users</li> <li>`failed` - the asset failed to copy or delete</li> <li>`deleted` - the asset has been deleted</li> </ul> Status string `json:"status"` // The time the asset was created. Created string `json:"created"` // The time the asset status was last updated. Updated string `json:"updated"` }
AssetResponseAttributes - The list of asset attributes and their values.
type AssetResponseData ¶
type AssetResponseData struct { // The type of resource, in this case it is an assets. Type string `json:"type"` Attributes AssetResponseAttributes `json:"attributes"` }
AssetResponseData - The type of resource (an asset) and attributes of the asset.
type AudioAsset ¶
type AudioAsset struct { // The type of asset - set to `audio` for audio assets. Type string `json:"type"` // The audio source URL. The URL must be publicly accessible or include credentials. Src string `json:"src"` // The start trim point of the audio clip, in seconds (defaults to 0). Audio will start from the in trim point. The audio will play until the file ends or the Clip length is reached. Trim float32 `json:"trim,omitempty"` // Set the volume for the audio clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1). Volume float32 `json:"volume,omitempty"` // The effect to apply to the audio asset <ul> <li>`fadeIn` - fade volume in only</li> <li>`fadeOut` - fade volume out only</li> <li>`fadeInFadeOut` - fade volume in and out</li> </ul> Effect string `json:"effect,omitempty"` }
AudioAsset - The AudioAsset is used to add sound effects and audio at specific intervals on the timeline. The src must be a publicly accessible URL to an audio resource such as an mp3 file.
type Clip ¶
type Clip struct { Asset Asset `json:"asset"` TypedAsset interface{} `json:"-"` // The start position of the Clip on the timeline, in seconds. Start float32 `json:"start"` // The length, in seconds, the Clip should play for. Length float32 `json:"length"` // Set how the asset should be scaled to fit the viewport using one of the following options: <ul> <li>`cover` - stretch the asset to fill the viewport without maintaining the aspect ratio.</li> <li>`contain` - fit the entire asset within the viewport while maintaining the original aspect ratio.</li> <li>`crop` - scale the asset to fill the viewport while maintaining the aspect ratio. The asset will be cropped if it exceeds the bounds of the viewport.</li> <li>`none` - preserves the original asset dimensions and does not apply any scaling.</li> </ul> Fit string `json:"fit,omitempty"` // Scale the asset to a fraction of the viewport size - i.e. setting the scale to 0.5 will scale asset to half the size of the viewport. This is useful for picture-in-picture video and scaling images such as logos and watermarks. Scale *float32 `json:"scale,omitempty"` // Place the asset in one of nine predefined positions of the viewport. This is most effective for when the asset is scaled and you want to position the element to a specific position. <ul> <li>`top` - top (center)</li> <li>`topRight` - top right</li> <li>`right` - right (center)</li> <li>`bottomRight` - bottom right</li> <li>`bottom` - bottom (center)</li> <li>`bottomLeft` - bottom left</li> <li>`left` - left (center)</li> <li>`topLeft` - top left</li> <li>`center` - center</li> </ul> Position string `json:"position,omitempty"` Offset *Offset `json:"offset,omitempty"` Transition *Transition `json:"transition,omitempty"` // A motion effect to apply to the Clip. <ul> <li>`zoomIn` - slow zoom in</li> <li>`zoomOut` - slow zoom out</li> <li>`slideLeft` - slow slide (pan) left</li> <li>`slideRight` - slow slide (pan) right</li> <li>`slideUp` - slow slide (pan) up</li> <li>`slideDown` - slow slide (pan) down</li> </ul> Effect string `json:"effect,omitempty"` // A filter effect to apply to the Clip. <ul> <li>`boost` - boost contrast and saturation</li> <li>`contrast` - increase contrast</li> <li>`darken` - darken the scene</li> <li>`greyscale` - remove color</li> <li>`lighten` - lighten the scene</li> <li>`muted` - reduce saturation and contrast</li> <li>`invert` - invert colors</li> </ul> Filter string `json:"filter,omitempty"` // Sets the opacity of the Clip where 1 is opaque and 0 is transparent. Opacity float32 `json:"opacity,omitempty"` Transform *Transformation `json:"transform,omitempty"` }
Clip - A clip is a container for a specific type of asset, i.e. a title, image, video, audio or html. You use a Clip to define when an asset will display on the timeline, how long it will play for and transitions, filters and effects to apply to it.
type Crop ¶
type Crop struct { // Crop from the top of the asset Top float32 `json:"top,omitempty"` // Crop from the bottom of the asset Bottom float32 `json:"bottom,omitempty"` // Crop from the left of the asset Left float32 `json:"left,omitempty"` // Crop from the left of the asset Right float32 `json:"right,omitempty"` }
Crop - Crop the sides of an asset by a relative amount. The size of the crop is specified using a scale between 0 and 1, relative to the screen width - i.e a left crop of 0.5 will crop half of the asset from the left, a top crop of 0.25 will crop the top by quarter of the asset.
type Destinations ¶
type Destinations struct { // The destination to send rendered assets to - set to `mux` for Mux. Provider string `json:"provider"` // Set to `true` to opt-out from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering. Exclude bool `json:"exclude,omitempty"` Options MuxDestinationOptions `json:"options,omitempty"` }
Destinations - A destination is a location where output files can be sent to for serving or hosting. By default all rendered assets are automatically sent to the [Shotstack hosting destination](https://shotstack.io/docs/guide/serving-assets/hosting). You can add other destinations to send assets to. The following destinations are available: <ul> <li><a href=\"#tocs_shotstackdestination\">DestinationShotstack</a></li> <li><a href=\"#tocs_muxdestination\">DestinationMux</a></li> </ul>
type DownloadAPIController ¶
type DownloadAPIController struct {
// contains filtered or unexported fields
}
DownloadAPIController binds http requests to an api service and writes the service results to the http response
func (*DownloadAPIController) DownloadByID ¶
func (c *DownloadAPIController) DownloadByID(w http.ResponseWriter, r *http.Request)
DownloadByID - Download Asset by ID
func (*DownloadAPIController) Routes ¶
func (c *DownloadAPIController) Routes() Routes
Routes returns all the api routes for the DownloadAPIController
type DownloadAPIOption ¶
type DownloadAPIOption func(*DownloadAPIController)
DownloadAPIOption for how the controller is set up.
func WithDownloadAPIErrorHandler ¶
func WithDownloadAPIErrorHandler(h ErrorHandler) DownloadAPIOption
WithDownloadApiErrorHandler inject ErrorHandler into controller
type DownloadAPIRouter ¶
type DownloadAPIRouter interface {
DownloadByID(http.ResponseWriter, *http.Request)
}
DownloadApiRouter defines the required methods for binding the api requests to a responses for the DownloadApi The DownloadApiRouter implementation should parse necessary information from the http request, pass the data to a DownloadApiServicer to perform the required actions, then write the service results to the http response.
type DownloadAPIService ¶
type DownloadAPIService struct {
// contains filtered or unexported fields
}
DownloadAPIService is a service that implements the logic for the DownloadAPIServicer This service should implement the business logic for every endpoint for the DownloadApi API. Include any external packages or services that will be required by this service.
func (*DownloadAPIService) DownloadByID ¶
func (s *DownloadAPIService) DownloadByID(ctx context.Context, id string) (ImplResponse, error)
DownloadByID - Download Asset by ID
type DownloadAPIServicer ¶
type DownloadAPIServicer interface {
DownloadByID(context.Context, string) (ImplResponse, error)
}
DownloadApiServicer defines the api actions for the DownloadApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
func NewDownloadAPIService ¶
func NewDownloadAPIService(cfg config.ShottowerConfiguration, editAPI EditAPIServicer) DownloadAPIServicer
NewDownloadAPIService creates a default api service
type Edit ¶
type Edit struct { Timeline Timeline `json:"timeline"` Output Output `json:"output"` // An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`. Merge []MergeField `json:"merge,omitempty"` // An optional webhook callback URL used to receive status notifications when a render completes or fails. See [webhooks](https://shotstack.io/docs/guide/architecting-an-application/webhooks) for more details. Callback string `json:"callback,omitempty"` // The disk type to use for storing footage and assets for each render. See [disk types](https://shotstack.io/docs/guide/architecting-an-application/disk-types) for more details. <ul> <li>`local` - optimized for high speed rendering with up to 512MB storage</li> <li>`mount` - optimized for larger file sizes and longer videos with 5GB for source footage and 512MB for output render</li> </ul> Disk string `json:"disk,omitempty"` }
Edit - An edit defines the arrangement of a video on a timeline, an audio edit or an image design and the output format.
type EditAPIController ¶
type EditAPIController struct {
// contains filtered or unexported fields
}
EditAPIController binds http requests to an api service and writes the service results to the http response
func (*EditAPIController) DeleteTemplate ¶
func (c *EditAPIController) DeleteTemplate(w http.ResponseWriter, r *http.Request)
DeleteTemplate - Delete Template
func (*EditAPIController) GetRender ¶
func (c *EditAPIController) GetRender(w http.ResponseWriter, r *http.Request)
GetRender - Get Render Status
func (*EditAPIController) GetTemplate ¶
func (c *EditAPIController) GetTemplate(w http.ResponseWriter, r *http.Request)
GetTemplate - Retrieve Template
func (*EditAPIController) GetTemplates ¶
func (c *EditAPIController) GetTemplates(w http.ResponseWriter, r *http.Request)
GetTemplates - List Templates
func (*EditAPIController) PostRender ¶
func (c *EditAPIController) PostRender(w http.ResponseWriter, r *http.Request)
PostRender - Render Asset
func (*EditAPIController) PostTemplate ¶
func (c *EditAPIController) PostTemplate(w http.ResponseWriter, r *http.Request)
PostTemplate - Create Template
func (*EditAPIController) PostTemplateRender ¶
func (c *EditAPIController) PostTemplateRender(w http.ResponseWriter, r *http.Request)
PostTemplateRender - Render Template
func (*EditAPIController) Probe ¶
func (c *EditAPIController) Probe(w http.ResponseWriter, r *http.Request)
Probe - Inspect Media
func (*EditAPIController) PutTemplate ¶
func (c *EditAPIController) PutTemplate(w http.ResponseWriter, r *http.Request)
PutTemplate - Update Template
func (*EditAPIController) Routes ¶
func (c *EditAPIController) Routes() Routes
Routes returns all the api routes for the EditAPIController
type EditAPIOption ¶
type EditAPIOption func(*EditAPIController)
EditAPIOption for how the controller is set up.
func WithEditAPIErrorHandler ¶
func WithEditAPIErrorHandler(h ErrorHandler) EditAPIOption
WithEditAPIErrorHandler inject ErrorHandler into controller
type EditAPIRouter ¶
type EditAPIRouter interface { DeleteTemplate(http.ResponseWriter, *http.Request) GetRender(http.ResponseWriter, *http.Request) GetTemplate(http.ResponseWriter, *http.Request) GetTemplates(http.ResponseWriter, *http.Request) PostRender(http.ResponseWriter, *http.Request) PostTemplate(http.ResponseWriter, *http.Request) PostTemplateRender(http.ResponseWriter, *http.Request) Probe(http.ResponseWriter, *http.Request) PutTemplate(http.ResponseWriter, *http.Request) }
EditAPIRouter defines the required methods for binding the api requests to a responses for the EditApi The EditAPIRouter implementation should parse necessary information from the http request, pass the data to a EditAPIServicer to perform the required actions, then write the service results to the http response.
type EditAPIService ¶
type EditAPIService struct {
// contains filtered or unexported fields
}
EditAPIService is a service that implements the logic for the EditAPIServicer This service should implement the business logic for every endpoint for the EditApi API. Include any external packages or services that will be required by this service.
func (*EditAPIService) DeleteTemplate ¶
func (s *EditAPIService) DeleteTemplate(ctx context.Context, id string) (ImplResponse, error)
DeleteTemplate - Delete Template
func (*EditAPIService) GetQueue ¶
func (s *EditAPIService) GetQueue() []*RenderQueue
func (*EditAPIService) GetQueuePending ¶
func (s *EditAPIService) GetQueuePending() []*RenderQueue
func (*EditAPIService) GetRender ¶
func (s *EditAPIService) GetRender(ctx context.Context, id string, data bool, merged bool) (ImplResponse, error)
GetRender - Get Render Status
func (*EditAPIService) GetTemplate ¶
func (s *EditAPIService) GetTemplate(ctx context.Context, id string) (ImplResponse, error)
GetTemplate - Retrieve Template
func (*EditAPIService) GetTemplates ¶
func (s *EditAPIService) GetTemplates(ctx context.Context) (ImplResponse, error)
GetTemplates - List Templates
func (*EditAPIService) PostRender ¶
func (s *EditAPIService) PostRender(ctx context.Context, edit Edit) (ImplResponse, error)
PostRender - Render Asset
func (*EditAPIService) PostTemplate ¶
func (s *EditAPIService) PostTemplate(ctx context.Context, template Template) (ImplResponse, error)
PostTemplate - Create Template
func (*EditAPIService) PostTemplateRender ¶
func (s *EditAPIService) PostTemplateRender(ctx context.Context, templateRender TemplateRender) (ImplResponse, error)
PostTemplateRender - Render Template
func (*EditAPIService) Probe ¶
func (s *EditAPIService) Probe(ctx context.Context, url string) (ImplResponse, error)
Probe - Inspect Media
func (*EditAPIService) PutTemplate ¶
func (s *EditAPIService) PutTemplate(ctx context.Context, id string, template Template) (ImplResponse, error)
PutTemplate - Update Template
type EditAPIServicer ¶
type EditAPIServicer interface { DeleteTemplate(context.Context, string) (ImplResponse, error) GetRender(context.Context, string, bool, bool) (ImplResponse, error) GetTemplate(context.Context, string) (ImplResponse, error) GetTemplates(context.Context) (ImplResponse, error) PostRender(context.Context, Edit) (ImplResponse, error) PostTemplate(context.Context, Template) (ImplResponse, error) PostTemplateRender(context.Context, TemplateRender) (ImplResponse, error) Probe(context.Context, string) (ImplResponse, error) PutTemplate(context.Context, string, Template) (ImplResponse, error) GetQueue() []*RenderQueue GetQueuePending() []*RenderQueue }
EditAPIServicer defines the api actions for the EditApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
func NewEditAPIService ¶
func NewEditAPIService(cfg config.ShottowerConfiguration) EditAPIServicer
NewEditAPIService creates a default api service
type ErrorHandler ¶
type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
ErrorHandler defines the required method for handling error. You may implement it and inject this into a controller if you would like errors to be handled differently from the DefaultErrorHandler
type FFMPEG ¶
type FFMPEG struct {
// contains filtered or unexported fields
}
func (*FFMPEG) AddDefaultParams ¶
func (*FFMPEG) ClipAudioDelay ¶
func (*FFMPEG) ClipAudioMerge ¶
func (*FFMPEG) ClipAudioTrim ¶
func (*FFMPEG) ClipAudioVolume ¶
func (*FFMPEG) ClipFiller ¶
func (*FFMPEG) ClipFillerOverlay ¶
func (*FFMPEG) ClipResize ¶
func (*FFMPEG) ClipSubtitleBurn ¶
func (*FFMPEG) CloseTrack ¶
func (*FFMPEG) GenerateBackground ¶
func (*FFMPEG) GenerateFiller ¶
func (*FFMPEG) GetDuration ¶
func (*FFMPEG) GetOutputName ¶
func (*FFMPEG) GetResolution ¶
func (*FFMPEG) SetDefaultBackground ¶
func (*FFMPEG) SetOutputFormat ¶
func (*FFMPEG) SetOutputFps ¶
func (*FFMPEG) SetOutputResolution ¶
func (*FFMPEG) ToFFMPEG ¶
func (s *FFMPEG) ToFFMPEG(queue *RenderQueue) error
type FFMPEGCommand ¶
type FFMPEGCommand interface { AddSource(string) error AddDefaultParams() error ToString() []string AddTrack(int) error CloseTrack(int) error AddClip(int, string) error ClipTrim(int, int, int, float32, float32) string ClipImage(int, int, int, float32, float32) string ClipMerge(int, int, int, []string) string ClipRaw(int, int, int) string ClipResize(int, int, int, float32) string ClipFillerOverlay(int, int, int, string) string ClipSubtitleBurn(int, int, int, int) string AddAudioClip(int, string) error ClipAudioVolume(int, int, int, float32) string ClipAudioDelay(int, int, int, float32) string ClipAudioTrim(int, int, int, float32, float32) string ClipAudioMerge(int, int, int, []string) string SetOutputResolution(string) error SetOutputSize(*int32, *int32) error SetOutputFormat(string) error SetDefaultBackground(string) error GetResolution() string GenerateFiller(string) string GenerateBackground() string ToFFMPEG(*RenderQueue) error GetOutputName() string GetDuration() float32 }
func NewFFMPEGCommand ¶
func NewFFMPEGCommand() FFMPEGCommand
type FFMPEGSource ¶
type FFMPEGSource struct {
// contains filtered or unexported fields
}
type FFMPEGTrack ¶
type FFMPEGTrack struct {
// contains filtered or unexported fields
}
type FlipTransformation ¶
type FlipTransformation struct { // Flip a clip horizontally. Horizontal bool `json:"horizontal,omitempty"` // Flip a clip vertically. Vertical bool `json:"vertical,omitempty"` }
FlipTransformation - Flip a clip vertically or horizontally. Acts as a mirror effect of the clip along the selected plane.
type Font ¶
type Font struct { // The URL of the font file. The URL must be publicly accessible or include credentials. Src string `json:"src"` }
Font - Download a custom font to use with the HTML asset type, using the font name in the CSS or font tag. See our [custom fonts](https://shotstack.io/learn/html-custom-fonts/) getting started guide for more details.
type HTMLAsset ¶
type HTMLAsset struct { // The type of asset - set to `html` for HTML. Type string `json:"type"` // The HTML text string. See list of [supported HTML tags](https://shotstack.io/docs/guide/architecting-an-application/html-support#supported-html-tags). HTML string `json:"html"` // The CSS text string to apply styling to the HTML. See list of [support CSS properties](https://shotstack.io/docs/guide/architecting-an-application/html-support#supported-css-properties). CSS string `json:"css,omitempty"` // Set the width of the HTML asset bounding box in pixels. Text will wrap to fill the bounding box. Width int32 `json:"width,omitempty"` // Set the width of the HTML asset bounding box in pixels. Text and elements will be masked if they exceed the height of the bounding box. Height int32 `json:"height,omitempty"` // Apply a background color behind the HTML bounding box using. Set the text color using hexadecimal color notation. Transparency is supported by setting the first two characters of the hex string (opposite to HTML), i.e. #80ffffff will be white with 50% transparency. Background string `json:"background,omitempty"` // Place the HTML in one of nine predefined positions within the HTML area. <ul> <li>`top` - top (center)</li> <li>`topRight` - top right</li> <li>`right` - right (center)</li> <li>`bottomRight` - bottom right</li> <li>`bottom` - bottom (center)</li> <li>`bottomLeft` - bottom left</li> <li>`left` - left (center)</li> <li>`topLeft` - top left</li> <li>`center` - center</li> </ul> Position string `json:"position,omitempty"` }
HTMLAsset - The HTMLAsset clip type lets you create text based layout and formatting using HTML and CSS. You can also set the height and width of a bounding box for the HTML content to sit within. Text and elements will wrap within the bounding box.
type ImageAsset ¶
type ImageAsset struct { // The type of asset - set to `image` for images. Type string `json:"type"` // The image source URL. The URL must be publicly accessible or include credentials. Src string `json:"src"` Crop *Crop `json:"crop,omitempty"` }
ImageAsset - The ImageAsset is used to create video from images to compose an image. The src must be a publicly accessible URL to an image resource such as a jpg or png file.
type ImplResponse ¶
type ImplResponse struct { Code int Body interface{} }
ImplResponse response defines an error code with the associated body
func Response ¶
func Response(code int, body interface{}) ImplResponse
Response return a ImplResponse struct filled
type LumaAsset ¶
type LumaAsset struct { // The type of asset - set to `luma` for luma mattes. Type string `json:"type"` // The luma matte source URL. The URL must be publicly accessible or include credentials. Src string `json:"src"` // The start trim point of the luma matte clip, in seconds (defaults to 0). Videos will start from the in trim point. A luma matte video will play until the file ends or the Clip length is reached. Trim float32 `json:"trim,omitempty"` }
LumaAsset - The LumaAsset is used to create luma matte masks, transitions and effects between other assets. A luma matte is a grey scale image or animated video where the black areas are transparent and the white areas solid. The luma matte animation should be provided as an mp4 video file. The src must be a publicly accessible URL to the file.
type MergeField ¶
type MergeField struct { // The string to find <u>without</u> delimiters. Find string `json:"find"` // The replacement value. The replacement can be any valid JSON type - string, boolean, number, etc... Replace *interface{} `json:"replace"` }
MergeField - A merge field consists of a key; `find`, and a value; `replace`. Merge fields can be used to replace placeholders within the JSON edit to create re-usable templates. Placeholders should be a string with double brace delimiters, i.e. `\"{{NAME}}\"`. A placeholder can be used for any value within the JSON edit.
type MuxDestination ¶
type MuxDestination struct { // The destination to send rendered assets to - set to `mux` for Mux. Provider string `json:"provider"` Options MuxDestinationOptions `json:"options,omitempty"` }
MuxDestination - Send rendered videos to the [Mux](https://www.mux.com/) video hosting and streaming service. Add the `mux` destination provider to send the output video to Mux. Mux credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/mux), not in the request.
type MuxDestinationOptions ¶
type MuxDestinationOptions struct { // Sets the Mux `playback_policy` option. Value is an array of strings - use `public`, `signed`, or both. PlaybackPolicy []string `json:"playbackPolicy,omitempty"` }
MuxDestinationOptions - Pass additional options to control how Mux processes video. Currently supports playback policy option.
type Offset ¶
type Offset struct { // Offset an asset on the horizontal axis (left or right), range varies from -1 to 1. Positive numbers move the asset right, negative left. For all assets except titles the distance moved is relative to the width of the viewport - i.e. an X offset of 0.5 will move the asset half the screen width to the right. X float32 `json:"x,omitempty"` // Offset an asset on the vertical axis (up or down), range varies from -1 to 1. Positive numbers move the asset up, negative down. For all assets except titles the distance moved is relative to the height of the viewport - i.e. an Y offset of 0.5 will move the asset up half the screen height. Y float32 `json:"y,omitempty"` }
Offset - Offsets the position of an asset horizontally or vertically by a relative distance.
type Output ¶
type Output struct { // The output format and type of media file to generate. <ul> <li>`mp4` - mp4 video file</li> <li>`gif` - animated gif</li> <li>`jpg` - jpg image file</li> <li>`png` - png image file</li> <li>`bmp` - bmp image file</li> <li>`mp3` - mp3 audio file (audio only)</li> </ul> Format string `json:"format"` // The output resolution of the video or image. <ul> <li>`preview` - 512px x 288px @ 15fps</li> <li>`mobile` - 640px x 360px @ 25fps</li> <li>`sd` - 1024px x 576px @ 25fps</li> <li>`hd` - 1280px x 720px @ 25fps</li> <li>`1080` - 1920px x 1080px @ 25fps</li> <li>`360` - 640px x 360px @ 25fps</li> <li>`480` - 848px x 480px @ 25fps</li> <li>`540` - 960px x 540px @ 25fps</li> <li>`720` - 1280px x 720px @ 25fps</li> </ul> Resolution string `json:"resolution,omitempty"` // The aspect ratio (shape) of the video or image. Useful for social media output formats. Options are: <ul> <li>`16:9` - regular landscape/horizontal aspect ratio (default)</li> <li>`9:16` - vertical/portrait aspect ratio</li> <li>`1:1` - square aspect ratio</li> <li>`4:5` - short vertical/portrait aspect ratio</li> <li>`4:3` - legacy TV aspect ratio</li> </ul> AspectRatio string `json:"aspectRatio,omitempty"` Size *Size `json:"size,omitempty"` // Override the default frames per second. Useful for when the source footage is recorded at 30fps, i.e. on mobile devices. Lower frame rates can be used to add cinematic quality (24fps) or to create smaller file size/faster render times or animated gifs (12 or 15fps). Default is 25fps. <ul> <li>`12` - 12fps</li> <li>`15` - 15fps</li> <li>`24` - 24fps</li> <li>`23.976` - 23.976fps</li> <li>`25` - 25fps</li> <li>`29.97` - 29.97fps</li> <li>`30` - 30fps</li> </ul> Fps *float32 `json:"fps,omitempty" default:"25"` // Override the resolution and scale the video or image to render at a different size. When using scaleTo the asset should be edited at the resolution dimensions, i.e. use font sizes that look best at HD, then use scaleTo to output the file at SD and the text will be scaled to the correct size. This is useful if you want to create multiple asset sizes. <ul> <li>`preview` - 512px x 288px @ 15fps</li> <li>`mobile` - 640px x 360px @ 25fps</li> <li>`sd` - 1024px x 576px @25fps</li> <li>`hd` - 1280px x 720px @25fps</li> <li>`1080` - 1920px x 1080px @25fps</li> </ul> ScaleTo string `json:"scaleTo,omitempty"` // Adjust the output quality of the video, image or audio. Adjusting quality affects render speed, download speeds and storage requirements due to file size. The default `medium` provides the most optimized choice for all three factors. <ul> <li>`low` - slightly reduced quality, smaller file size</li> <li>`medium` - optimized quality, render speeds and file size</li> <li>`high` - slightly increased quality, larger file size</li> </ul> Quality string `json:"quality,omitempty" default:"medium"` // Loop settings for gif files. Set to `true` to loop, `false` to play only once. Repeat bool `json:"repeat,omitempty"` Range *Range `json:"range,omitempty"` Poster *Poster `json:"poster,omitempty"` Thumbnail *Thumbnail `json:"thumbnail,omitempty"` Destinations []Destinations `json:"destinations,omitempty"` }
Output - The output format, render range and type of media to generate.
type ParsingError ¶
type ParsingError struct {
Err error
}
ParsingError indicates that an error has occurred when parsing request parameters
func (*ParsingError) Error ¶
func (e *ParsingError) Error() string
func (*ParsingError) Unwrap ¶
func (e *ParsingError) Unwrap() error
type Poster ¶
type Poster struct { // The point on the timeline in seconds to capture a single frame to use as the poster image. Capture float32 `json:"capture"` }
Poster - Generate a poster image for the video at a specific point from the timeline. The poster image size will match the size of the output video.
type ProbeResponse ¶
type ProbeResponse struct { // `true` if media successfully read, else `false`. Success bool `json:"success"` // `Created`, `Bad Request` or an error message. Message string `json:"message"` // The response from FFprobe in JSON format. Response map[string]interface{} `json:"response"` }
ProbeResponse - The response received after a [probe request](#inspect-media) is submitted. The probe requests returns data from FFprobe formatted as JSON.
type ProcessingQueue ¶
type ProcessingQueue struct {
// contains filtered or unexported fields
}
func (*ProcessingQueue) DownloadFile ¶
func (s *ProcessingQueue) DownloadFile(url string) (string, error)
func (*ProcessingQueue) ExecuteFFMpeg ¶
func (s *ProcessingQueue) ExecuteFFMpeg(params []string)
func (*ProcessingQueue) FetchAssets ¶
func (s *ProcessingQueue) FetchAssets(queue *RenderQueue)
func (*ProcessingQueue) GenerateParameters ¶
func (s *ProcessingQueue) GenerateParameters(queue *RenderQueue) []string
func (*ProcessingQueue) ProcessQueue ¶
func (s *ProcessingQueue) ProcessQueue(editAPI EditAPIServicer)
func (*ProcessingQueue) StartProcessQueue ¶
func (s *ProcessingQueue) StartProcessQueue(editAPI EditAPIServicer)
type ProcessingQueuer ¶
type ProcessingQueuer interface {
StartProcessQueue(EditAPIServicer)
}
ProcessingQueuer defines the queue actions while processing new renders
func NewProcessingQueuer ¶
func NewProcessingQueuer() ProcessingQueuer
type QueuedResponse ¶
type QueuedResponse struct { // `true` if successfully queued, else `false`. Success bool `json:"success"` // `Created`, `Bad Request` or an error message. Message string `json:"message"` Response QueuedResponseData `json:"response"` }
QueuedResponse - The response received after a [render request](#render-asset) or [template render](#render-template) is submitted. The render task is queued for rendering and a unique render id is returned.
type QueuedResponseData ¶
type QueuedResponseData struct { // Success response message or error details. Message string `json:"message"` // The id of the render task in UUID format. ID string `json:"id"` }
QueuedResponseData - The response data returned with the QueuedResponse(#tocs_queuedresponse).
type Range ¶
type Range struct { // The point on the timeline, in seconds, to start the render from - i.e. start at second 3. Start *float32 `json:"start,omitempty"` // The length of the portion of the video or audio to render - i.e. render 6 seconds of the video. Length *float32 `json:"length,omitempty"` }
Range - Specify a time range to render, i.e. to render only a portion of a video or audio file. Omit this setting to export the entire video. Range can also be used to render a frame at a specific time point - setting a range and output format as `jpg` will output a single frame image at the range `start` point.
type RenderQueue ¶
type RenderQueue struct { // The id of the render task in UUID format. ID string `json:"id"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Data Edit `json:"data"` Status RenderResponseStatus FileName string InternalStatus RenderResponseStatus LocalResources []string FFMPEGCommand FFMPEGCommand }
type RenderResponse ¶
type RenderResponse struct { // `true` if status available, else `false`. Success bool `json:"success"` // `OK` or an error message. Message string `json:"message"` Response RenderResponseData `json:"response"` }
RenderResponse - The response received after a [render status request](#get-render-status) is submitted. The response includes details about status of a render and the output URL.
type RenderResponseData ¶
type RenderResponseData struct { // The id of the render task in UUID format. ID string `json:"id"` // The owner id of the render task. Owner string `json:"owner"` // The customer subscription plan. Plan string `json:"plan,omitempty"` // The status of the render task. <ul> <li>`queued` - render is queued waiting to be rendered</li> <li>`fetching` - assets are being fetched</li> <li>`rendering` - the asset is being rendered</li> <li>`saving` - the final asset is being saved to storage</li> <li>`done` - the asset is ready to be downloaded</li> <li>`failed` - there was an error rendering the asset</li> </ul> Status string `json:"status"` // An error message, only displayed if an error occurred. Error string `json:"error,omitempty"` // The output video or audio length in seconds. Duration float32 `json:"duration,omitempty"` // The time taken to render the asset in milliseconds. RenderTime float32 `json:"renderTime,omitempty"` // The URL of the final asset. This will only be available if status is done. This is a temporary URL and will be deleted after 24 hours. By default all assets are copied to the Shotstack hosting and CDN destination. URL string `json:"url,omitempty"` // The URL of the poster image if requested. This will only be available if status is done. Poster string `json:"poster,omitempty"` // The URL of the thumbnail image if requested. This will only be available if status is done. Thumbnail string `json:"thumbnail,omitempty"` Data Edit `json:"data"` // The time the render task was initially queued. Created string `json:"created"` // The time the render status was last updated. Updated string `json:"updated"` }
RenderResponseData - The response data returned with the RenderResponse(#tocs_renderresponse) including status and URL.
type RenderResponseStatus ¶
type RenderResponseStatus int64
const ( Queued RenderResponseStatus = iota Fetching Rendering Saving Done Failed // Internal Fetched Rendered Generating Generated )
func (RenderResponseStatus) String ¶
func (s RenderResponseStatus) String() string
type RequiredError ¶
RequiredError indicates that an error has occurred when parsing request parameters
func (*RequiredError) Error ¶
func (e *RequiredError) Error() string
type RotateTransformation ¶
type RotateTransformation struct { // The angle to rotate the clip. Can be 0 to 360, or 0 to -360. Using a positive number rotates the clip clockwise, negative numbers counter-clockwise. Angle int32 `json:"angle,omitempty"` }
RotateTransformation - Rotate a clip by the specified angle in degrees. Rotation origin is set based on the clips `position`.
type Route ¶
type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc }
A Route defines the parameters for an api endpoint
type Router ¶
type Router interface {
Routes() Routes
}
Router defines the required methods for retrieving api routes
func NewDownloadAPIController ¶
func NewDownloadAPIController(s DownloadAPIServicer, opts ...DownloadAPIOption) Router
NewDownloadAPIController creates a default api controller
func NewEditAPIController ¶
func NewEditAPIController(s EditAPIServicer, opts ...EditAPIOption) Router
NewEditAPIController creates a default api controller
func NewServeAPIController ¶
func NewServeAPIController(s ServeAPIServicer, opts ...ServeAPIOption) Router
NewServeAPIController creates a default api controller
type ServeAPIController ¶
type ServeAPIController struct {
// contains filtered or unexported fields
}
ServeAPIController binds http requests to an api service and writes the service results to the http response
func (*ServeAPIController) DeleteAsset ¶
func (c *ServeAPIController) DeleteAsset(w http.ResponseWriter, r *http.Request)
DeleteAsset - Delete Asset
func (*ServeAPIController) GetAsset ¶
func (c *ServeAPIController) GetAsset(w http.ResponseWriter, r *http.Request)
GetAsset - Get Asset
func (*ServeAPIController) GetAssetByRenderID ¶
func (c *ServeAPIController) GetAssetByRenderID(w http.ResponseWriter, r *http.Request)
GetAssetByRenderID - Get Asset by Render ID
func (*ServeAPIController) Routes ¶
func (c *ServeAPIController) Routes() Routes
Routes returns all the api routes for the ServeAPIController
type ServeAPIOption ¶
type ServeAPIOption func(*ServeAPIController)
ServeAPIOption for how the controller is set up.
func WithServeAPIErrorHandler ¶
func WithServeAPIErrorHandler(h ErrorHandler) ServeAPIOption
WithServeAPIErrorHandler inject ErrorHandler into controller
type ServeAPIRouter ¶
type ServeAPIRouter interface { DeleteAsset(http.ResponseWriter, *http.Request) GetAsset(http.ResponseWriter, *http.Request) GetAssetByRenderID(http.ResponseWriter, *http.Request) }
ServeAPIRouter defines the required methods for binding the api requests to a responses for the ServeApi The ServeAPIRouter implementation should parse necessary information from the http request, pass the data to a ServeAPIServicer to perform the required actions, then write the service results to the http response.
type ServeAPIService ¶
type ServeAPIService struct {
// contains filtered or unexported fields
}
ServeAPIService is a service that implements the logic for the ServeAPIServicer This service should implement the business logic for every endpoint for the ServeApi API. Include any external packages or services that will be required by this service.
func (*ServeAPIService) DeleteAsset ¶
func (s *ServeAPIService) DeleteAsset(ctx context.Context, id string) (ImplResponse, error)
DeleteAsset - Delete Asset
func (*ServeAPIService) GetAsset ¶
func (s *ServeAPIService) GetAsset(ctx context.Context, id string) (ImplResponse, error)
GetAsset - Get Asset
func (*ServeAPIService) GetAssetByRenderID ¶
func (s *ServeAPIService) GetAssetByRenderID(ctx context.Context, id string) (ImplResponse, error)
GetAssetByRenderID - Get Asset by Render ID
type ServeAPIServicer ¶
type ServeAPIServicer interface { DeleteAsset(context.Context, string) (ImplResponse, error) GetAsset(context.Context, string) (ImplResponse, error) GetAssetByRenderID(context.Context, string) (ImplResponse, error) }
ServeAPIServicer defines the api actions for the ServeApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
func NewServeAPIService ¶
func NewServeAPIService(cfg config.ShottowerConfiguration) ServeAPIServicer
NewServeAPIService creates a default api service
type ShotstackDestination ¶
type ShotstackDestination struct { // The destination to send rendered assets to - set to `shotstack` for Shotstack hosting and CDN. Provider string `json:"provider"` // Set to `true` to opt-out from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering. Exclude bool `json:"exclude,omitempty"` }
ShotstackDestination - Send rendered assets to the Shotstack hosting and CDN service. This destination is enabled by default.
type Size ¶
type Size struct { // Set a custom width for the video or image file. Value must be divisible by 2. Maximum video width is 1920px, maximum image width is 4096px. Width *int32 `json:"width,omitempty"` // Set a custom height for the video or image file. Value must be divisible by 2. Maximum video height is 1920px, maximum image height is 4096px. Height *int32 `json:"height,omitempty"` }
Size - Set a custom size for a video or image. When using a custom size omit the `resolution` and `aspectRatio`. Custom sizes must be divisible by 2 based on the encoder specifications.
type SkewTransformation ¶
type SkewTransformation struct { // Skew the clip along it's x axis. X float32 `json:"x,omitempty"` // Skew the clip along it's y axis. Y float32 `json:"y,omitempty"` }
SkewTransformation - Skew a clip so its edges are sheared at an angle. Use values between 0 and 3. Over 3 the clip will be skewed almost flat.
type Soundtrack ¶
type Soundtrack struct { // The URL of the mp3 audio file. The URL must be publicly accessible or include credentials. Src string `json:"src"` // The effect to apply to the audio file <ul> <li>`fadeIn` - fade volume in only</li> <li>`fadeOut` - fade volume out only</li> <li>`fadeInFadeOut` - fade volume in and out</li> </ul> Effect string `json:"effect,omitempty"` // Set the volume for the soundtrack between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1). Volume float32 `json:"volume,omitempty" default:"1"` }
Soundtrack - A music or audio file in mp3 format that plays for the duration of the rendered video or the length of the audio file, which ever is shortest.
type Subtitle ¶
type Subtitle struct { // Index of the subtitle stream (Default to 0). Index int `json:"index,omitempty" default:"0"` }
Subtitle - Subtitle allow to burn a specific subtitle into the video
type Template ¶
type Template struct { // The template name Name string `json:"name"` Template Edit `json:"template,omitempty"` }
Template - A template is a saved Edit(#tocs_edit) than can be loaded and re-used.
type TemplateDataResponse ¶
type TemplateDataResponse struct { // `true` if successfully created, else `false`. Success bool `json:"success"` // `OK`, `Bad Request` or an error message. Message string `json:"message"` Response TemplateDataResponseData `json:"response"` }
TemplateDataResponse - The template data including the template name and Edit.
type TemplateDataResponseData ¶
type TemplateDataResponseData struct { // The unique id of the template in UUID format. ID string `json:"id"` // The template name. Name string `json:"name"` // The owner id of the templates. Owner string `json:"owner"` // The [Edit](#tocs_edit) template. Template string `json:"template"` }
TemplateDataResponseData - The response data returned with the TemplateDataResponse(#tocs_templatedataresponse).
type TemplateListResponse ¶
type TemplateListResponse struct { // `true` if successfully created, else `false`. Success bool `json:"success"` // `Created`, `Bad Request` or an error message. Message string `json:"message"` Response TemplateListResponseData `json:"response"` }
TemplateListResponse - A list of previously saved templates.
type TemplateListResponseData ¶
type TemplateListResponseData struct { // The owner id of the templates. Owner string `json:"owner"` // The list of templates. Templates []TemplateListResponseItem `json:"templates"` }
TemplateListResponseData - The response data returned with the TemplateListResponse(#tocs_templatelistresponse).
type TemplateListResponseItem ¶
type TemplateListResponseItem struct { // The unique id of the template in UUID format. ID string `json:"id"` // The template name Name string `json:"name"` // The time the template was created. Created string `json:"created"` // The time the template was last updated. Updated string `json:"updated"` }
TemplateListResponseItem - The individual template item returned with the TemplateListResponseData(#tocs_templatelistresponsedata) templates list.
type TemplateRender ¶
type TemplateRender struct { // The id of the template to render in UUID format. ID string `json:"id"` // An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`. Merge []MergeField `json:"merge,omitempty"` }
TemplateRender - Render a template by it's id and optional merge fields.
type TemplateResponse ¶
type TemplateResponse struct { // `true` if successfully created, else `false`. Success bool `json:"success"` // `Created`, `Bad Request` or an error message. Message string `json:"message"` Response TemplateResponseData `json:"response"` }
TemplateResponse - The response received after a [template](#create-a-template) is submitted. The template is saved and a unique template id is returned.
type TemplateResponseData ¶
type TemplateResponseData struct { // Success response message or error details. Message string `json:"message"` // The unique id of the template in UUID format. ID string `json:"id"` }
TemplateResponseData - The response data returned with the TemplateResponse(#tocs_templateresponse).
type Thumbnail ¶
type Thumbnail struct { // The point on the timeline in seconds to capture a single frame to use as the thumbnail image. Capture float32 `json:"capture"` // Scale the thumbnail size to a fraction of the viewport size - i.e. setting the scale to 0.5 will scale the thumbnail to half the size of the viewport. Scale float32 `json:"scale"` }
Thumbnail - Generate a thumbnail image for the video or image at a specific point from the timeline.
type Timeline ¶
type Timeline struct { Soundtrack *Soundtrack `json:"soundtrack,omitempty"` // A hexadecimal value for the timeline background color. Defaults to #000000 (black). Background string `json:"background,omitempty" default:"#000000"` // An array of custom fonts to be downloaded for use by the HTML assets. Fonts []Font `json:"fonts,omitempty"` // A timeline consists of an array of tracks, each track containing clips. Tracks are layered on top of each other in the same order they are added to the array with the top most track layered over the top of those below it. Ensure that a track containing titles is the top most track so that it is displayed above videos and images. Tracks []Track `json:"tracks"` // Disable the caching of ingested source footage and assets. See [caching](https://shotstack.io/docs/guide/architecting-an-application/caching) for more details. Cache bool `json:"cache,omitempty"` }
Timeline - A timeline represents the contents of a video edit over time, an audio edit over time, in seconds, or an image layout. A timeline consists of layers called tracks. Tracks are composed of titles, images, audio, html or video segments referred to as clips which are placed along the track at specific starting point and lasting for a specific amount of time.
type TitleAsset ¶
type TitleAsset struct { // The type of asset - set to `title` for titles. Type string `json:"type"` // The title text string - i.e. \"My Title\". Text string `json:"text"` // Uses a preset to apply font properties and styling to the title. <ul> <li>`minimal`</li> <li>`blockbuster`</li> <li>`vogue`</li> <li>`sketchy`</li> <li>`skinny`</li> <li>`chunk`</li> <li>`chunkLight`</li> <li>`marker`</li> <li>`future`</li> <li>`subtitle`</li> </ul> Style string `json:"style,omitempty"` // Set the text color using hexadecimal color notation. Transparency is supported by setting the first two characters of the hex string (opposite to HTML), i.e. #80ffffff will be white with 50% transparency. Color string `json:"color,omitempty"` // Set the relative size of the text using predefined sizes from xx-small to xx-large. <ul> <li>`xx-small`</li> <li>`x-small`</li> <li>`small`</li> <li>`medium`</li> <li>`large`</li> <li>`x-large`</li> <li>`xx-large`</li> </ul> Size string `json:"size,omitempty"` // Apply a background color behind the text. Set the text color using hexadecimal color notation. Transparency is supported by setting the first two characters of the hex string (opposite to HTML), i.e. #80ffffff will be white with 50% transparency. Omit to use transparent background. Background string `json:"background,omitempty"` // Place the title in one of nine predefined positions of the viewport. <ul> <li>`top` - top (center)</li> <li>`topRight` - top right</li> <li>`right` - right (center)</li> <li>`bottomRight` - bottom right</li> <li>`bottom` - bottom (center)</li> <li>`bottomLeft` - bottom left</li> <li>`left` - left (center)</li> <li>`topLeft` - top left</li> <li>`center` - center</li> </ul> Position string `json:"position,omitempty"` Offset Offset `json:"offset,omitempty"` }
TitleAsset - The TitleAsset clip type lets you create video titles from a text string and apply styling and positioning.
type Track ¶
type Track struct { // An array of Clips comprising of TitleClip, ImageClip or VideoClip. Clips []Clip `json:"clips"` }
Track - A track contains an array of clips. Tracks are layered on top of each other in the order in the array. The top most track will render on top of those below it.
type Transformation ¶
type Transformation struct { Rotate RotateTransformation `json:"rotate,omitempty"` Skew SkewTransformation `json:"skew,omitempty"` Flip FlipTransformation `json:"flip,omitempty"` }
Transformation - Apply one or more transformations to a clip. Transformations alter the visual properties of a clip and can be combined to create new shapes and effects.
type Transition ¶
type Transition struct { // The transition in. Available transitions are: <ul> <li>`fade` - fade in</li> <li>`reveal` - reveal from left to right</li> <li>`wipeLeft` - fade across screen to the left</li> <li>`wipeRight` - fade across screen to the right</li> <li>`slideLeft` - move slightly left and fade in</li> <li>`slideRight` - move slightly right and fade in</li> <li>`slideUp` - move slightly up and fade in</li> <li>`slideDown` - move slightly down and fade in</li> <li>`carouselLeft` - slide in from right to left</li> <li>`carouselRight` - slide in from left to right</li> <li>`carouselUp` - slide in from bottom to top</li> <li>`carouselDown` - slide in from top to bottom</li> <li>`shuffleTopRight` - rotate in from top right</li> <li>`shuffleRightTop` - rotate in from right top</li> <li>`shuffleRightBottom` - rotate in from right bottom</li> <li>`shuffleBottomRight` - rotate in from bottom right</li> <li>`shuffleBottomLeft` - rotate in from bottom left</li> <li>`shuffleLeftBottom` - rotate in from left bottom</li> <li>`shuffleLeftTop` - rotate in from left top</li> <li>`shuffleTopLeft` - rotate in from top left</li> <li>`zoom` - fast zoom in</li> </ul> The transition speed can also be controlled by appending `Fast` or `Slow` to the transition, e.g. `fadeFast` or `CarouselLeftSlow`. In string `json:"in,omitempty"` // The transition out. Available transitions are: <ul> <li>`fade` - fade out</li> <li>`reveal` - reveal from right to left</li> <li>`wipeLeft` - fade across screen to the left</li> <li>`wipeRight` - fade across screen to the right</li> <li>`slideLeft` - move slightly left and fade out</li> <li>`slideRight` - move slightly right and fade out</li> <li>`slideUp` - move slightly up and fade out</li> <li>`slideDown` - move slightly down and fade out</li> <li>`carouselLeft` - slide out from right to left</li> <li>`carouselRight` - slide out from left to right</li> <li>`carouselUp` - slide out from bottom to top</li> <li>`carouselDown` - slide out from top to bottom</li> <li>`shuffleTopRight` - rotate out from top right</li> <li>`shuffleRightTop` - rotate out from right top</li> <li>`shuffleRightBottom` - rotate out from right bottom</li> <li>`shuffleBottomRight` - rotate out from bottom right</li> <li>`shuffleBottomLeft` - rotate out from bottom left</li> <li>`shuffleLeftBottom` - rotate out from left bottom</li> <li>`shuffleLeftTop` - rotate out from left top</li> <li>`shuffleTopLeft` - rotate out from top left</li> <li>`zoom` - fast zoom out</li> </ul> The transition speed can also be controlled by appending `Fast` or `Slow` to the transition, e.g. `fadeFast` or `CarouselLeftSlow`. Out string `json:"out,omitempty"` }
Transition - In and out transitions for a clip - i.e. fade in and fade out
type VideoAsset ¶
type VideoAsset struct { // The type of asset - set to `video` for videos. Type string `json:"type"` // The video source URL. The URL must be publicly accessible or include credentials. Src string `json:"src"` // The start trim point of the video clip, in seconds (defaults to 0). Videos will start from the in trim point. The video will play until the file ends or the Clip length is reached. Trim float32 `json:"trim,omitempty" default:"0"` // Set the volume for the video clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 0). Volume float32 `json:"volume,omitempty" default:"0"` Crop *Crop `json:"crop,omitempty"` Subtitle *Subtitle `json:"subtitle,omitempty"` }
VideoAsset - The VideoAsset is used to create video sequences from video files. The src must be a publicly accessible URL to a video resource such as an mp4 file.
Source Files ¶
- api.go
- api_download.go
- api_download_service.go
- api_edit.go
- api_edit_service.go
- api_serve.go
- api_serve_service.go
- error.go
- ffmpeg.go
- helpers.go
- impl.go
- logger.go
- model_asset.go
- model_asset_render_response.go
- model_asset_response.go
- model_asset_response_attributes.go
- model_asset_response_data.go
- model_audio_asset.go
- model_clip.go
- model_crop.go
- model_destinations.go
- model_edit.go
- model_ffmpeg.go
- model_flip_transformation.go
- model_font.go
- model_html_asset.go
- model_image_asset.go
- model_luma_asset.go
- model_merge_field.go
- model_mux_destination.go
- model_mux_destination_options.go
- model_offset.go
- model_output.go
- model_poster.go
- model_probe_response.go
- model_queued_response.go
- model_queued_response_data.go
- model_range.go
- model_render_queue.go
- model_render_response.go
- model_render_response_data.go
- model_rotate_transformation.go
- model_shotstack_destination.go
- model_size.go
- model_skew_transformation.go
- model_soundtrack.go
- model_subtitle.go
- model_template.go
- model_template_data_response.go
- model_template_data_response_data.go
- model_template_list_response.go
- model_template_list_response_data.go
- model_template_list_response_item.go
- model_template_render.go
- model_template_response.go
- model_template_response_data.go
- model_thumbnail.go
- model_timeline.go
- model_title_asset.go
- model_track.go
- model_transformation.go
- model_transition.go
- model_video_asset.go
- queue.go
- routers.go