Documentation
¶
Overview ¶
Package transcodely is the official Go SDK for the Transcodely video transcoding API.
Get an API key at https://transcodely.com and start transcoding:
import (
"context"
"log"
"os"
"github.com/transcodely/transcodely-go"
)
func main() {
client, err := transcodely.New(os.Getenv("TRANSCODELY_API_KEY"))
if err != nil {
log.Fatal(err)
}
job, err := client.Jobs.Create(context.Background(), &transcodely.JobCreateParams{
InputURL: "https://example.com/in.mp4",
Outputs: []*transcodely.OutputSpec{
{Type: transcodely.OutputFormatHLS, Video: []*transcodely.VideoVariant{
{Codec: transcodely.VideoCodecH264, Resolution: transcodely.Resolution1080P},
}},
},
})
if err != nil {
log.Fatal(err)
}
log.Printf("created %s in %s", job.GetId(), job.GetStatus())
}
All resources hang off the root Client: Jobs, Videos, Presets, Origins, Apps, APIKeys, Organizations, Memberships, Users, Health.
Errors are typed; switch on them with errors.As. See the Error interface for the common surface and APIConnectionError, APIError, AuthenticationError, PermissionError, NotFoundError, ConflictError, RateLimitError, InvalidRequestError, PreconditionError for the concrete classes.
Index ¶
- Constants
- Variables
- type APIConnectionError
- func (e *APIConnectionError) Error() string
- func (e *APIConnectionError) ErrorCode() string
- func (e *APIConnectionError) Errors() []FieldViolation
- func (e *APIConnectionError) HTTPStatus() int
- func (e *APIConnectionError) RequestID() string
- func (e *APIConnectionError) Type() string
- func (e *APIConnectionError) Unwrap() error
- type APIError
- type APIKey
- type APIKeyCreateParams
- type APIKeyListParams
- type APIKeys
- func (a *APIKeys) Create(ctx context.Context, params *APIKeyCreateParams) (*CreatedAPIKey, error)
- func (a *APIKeys) Get(ctx context.Context, id string) (*APIKey, error)
- func (a *APIKeys) List(ctx context.Context, params *APIKeyListParams) *Iter[*APIKey]
- func (a *APIKeys) Revoke(ctx context.Context, id string) error
- type AV1Options
- type App
- type AppCreateParams
- type AppListParams
- type AppUpdateParams
- type Apps
- func (a *Apps) Archive(ctx context.Context, id string) error
- func (a *Apps) Create(ctx context.Context, params *AppCreateParams) (*App, error)
- func (a *Apps) EnableHosting(ctx context.Context, id string) (*App, error)
- func (a *Apps) Get(ctx context.Context, id string) (*App, error)
- func (a *Apps) List(ctx context.Context, params *AppListParams) *Iter[*App]
- func (a *Apps) Update(ctx context.Context, params *AppUpdateParams) (*App, error)
- func (a *Apps) UpdateHostingConfig(ctx context.Context, params *v1.UpdateHostingConfigRequest) (*App, error)
- type AudioCodec
- type AudioSettings
- type AudioStreamInfo
- type AudioTrackConfig
- type AuthenticationError
- func (e *AuthenticationError) Error() string
- func (e *AuthenticationError) ErrorCode() string
- func (e *AuthenticationError) Errors() []FieldViolation
- func (e *AuthenticationError) HTTPStatus() int
- func (e *AuthenticationError) RequestID() string
- func (e *AuthenticationError) Type() string
- func (e *AuthenticationError) Unwrap() error
- type AutoABRConfig
- type AutoProfileDefaults
- type BYOKConfig
- type BitrateMode
- type BurnInStyle
- type Client
- type CompletedPart
- type ComponentHealth
- type ConflictError
- type Container
- type ContentAnalysis
- type ContentAwareConfig
- type ContentAwareMode
- type ContentType
- type CreateWebhookConfig
- type CreatedAPIKey
- type DASHConfig
- type DRMConfig
- type DRMSystem
- type DeliveryFormat
- type EncryptionScheme
- type Error
- type ErrorDetails
- type ExecutionTiming
- type FieldViolation
- type GOPAlignmentMode
- type GcsCredentials
- type GcsOriginConfig
- type H264Options
- type H265Options
- type HDRConfig
- type HDRFormat
- type HDRMode
- type HLSConfig
- type HLSPlaylistType
- type HLSSegmentFormat
- type Health
- type HealthCheckResponse
- type HostingConfig
- type HttpCredentials
- type HttpOriginConfig
- type InputMetadata
- type InvalidRequestError
- func (e *InvalidRequestError) Error() string
- func (e *InvalidRequestError) ErrorCode() string
- func (e *InvalidRequestError) Errors() []FieldViolation
- func (e *InvalidRequestError) HTTPStatus() int
- func (e *InvalidRequestError) RequestID() string
- func (e *InvalidRequestError) Type() string
- func (e *InvalidRequestError) Unwrap() error
- type Iter
- type Job
- type JobCreateParams
- type JobListParams
- type JobOutput
- type JobPriority
- type JobStatus
- type Jobs
- func (j *Jobs) Cancel(ctx context.Context, id string) (*Job, error)
- func (j *Jobs) Confirm(ctx context.Context, id string) (*Job, error)
- func (j *Jobs) Create(ctx context.Context, params *JobCreateParams) (*Job, error)
- func (j *Jobs) Get(ctx context.Context, id string) (*Job, error)
- func (j *Jobs) List(ctx context.Context, params *JobListParams) *Iter[*Job]
- func (j *Jobs) Watch(ctx context.Context, id string) *Stream[*WatchJobResponse]
- type KeyServerConfig
- type Membership
- type MembershipListParams
- type MembershipRole
- type MembershipWithUser
- type Memberships
- func (m *Memberships) Get(ctx context.Context, id string) (*MembershipWithUser, error)
- func (m *Memberships) List(ctx context.Context, params *MembershipListParams) *Iter[*MembershipWithUser]
- func (m *Memberships) Remove(ctx context.Context, id string) error
- func (m *Memberships) UpdateRole(ctx context.Context, id string, role MembershipRole) (*Membership, error)
- type MultipartAbortParams
- type MultipartCompleteParams
- type MultipartCreateParams
- type MultipartPartURLsParams
- type NotFoundError
- type Option
- type OrgCreateParams
- type OrgListParams
- type OrgUpdateParams
- type Organization
- type Organizations
- func (o *Organizations) CheckSlug(ctx context.Context, slug string) (*SlugCheckResult, error)
- func (o *Organizations) Create(ctx context.Context, params *OrgCreateParams) (*Organization, error)
- func (o *Organizations) Get(ctx context.Context, idOrSlug string) (*Organization, error)
- func (o *Organizations) List(ctx context.Context, params *OrgListParams) *Iter[*Organization]
- func (o *Organizations) Update(ctx context.Context, params *OrgUpdateParams) (*Organization, error)
- type Origin
- type OriginCreateParams
- type OriginListParams
- type OriginPermission
- type OriginProvider
- type OriginRef
- type OriginStatus
- type OriginUpdateParams
- type Origins
- func (o *Origins) Archive(ctx context.Context, id string) error
- func (o *Origins) Create(ctx context.Context, params *OriginCreateParams) (*Origin, error)
- func (o *Origins) Get(ctx context.Context, id string) (*Origin, error)
- func (o *Origins) List(ctx context.Context, params *OriginListParams) *Iter[*Origin]
- func (o *Origins) Update(ctx context.Context, params *OriginUpdateParams) (*Origin, error)
- func (o *Origins) Validate(ctx context.Context, id string) (*ValidationResult, error)
- type OutputFormat
- type OutputSpec
- type OutputStatus
- type PaginationRequest
- type PaginationResponse
- type PermissionError
- func (e *PermissionError) Error() string
- func (e *PermissionError) ErrorCode() string
- func (e *PermissionError) Errors() []FieldViolation
- func (e *PermissionError) HTTPStatus() int
- func (e *PermissionError) RequestID() string
- func (e *PermissionError) Type() string
- func (e *PermissionError) Unwrap() error
- type PreconditionError
- func (e *PreconditionError) Error() string
- func (e *PreconditionError) ErrorCode() string
- func (e *PreconditionError) Errors() []FieldViolation
- func (e *PreconditionError) HTTPStatus() int
- func (e *PreconditionError) RequestID() string
- func (e *PreconditionError) Type() string
- func (e *PreconditionError) Unwrap() error
- type Preset
- type PresetCreateParams
- type PresetListParams
- type PresetUpdateParams
- type PresetVariant
- type Presets
- func (p *Presets) Archive(ctx context.Context, id string) error
- func (p *Presets) Create(ctx context.Context, params *PresetCreateParams) (*Preset, error)
- func (p *Presets) Duplicate(ctx context.Context, sourceID, slug, name string) (*Preset, error)
- func (p *Presets) Get(ctx context.Context, id string) (*Preset, error)
- func (p *Presets) GetBySlug(ctx context.Context, slug string) (*Preset, error)
- func (p *Presets) List(ctx context.Context, params *PresetListParams) *Iter[*Preset]
- func (p *Presets) Update(ctx context.Context, params *PresetUpdateParams) (*Preset, error)
- type PricingSnapshot
- type ProtoFieldViolation
- type QualityTier
- type RateLimitError
- type Resolution
- type S3Credentials
- type S3OriginConfig
- type SegmentConfig
- type SlugCheckResult
- type Stream
- type StreamingConfig
- type SubtitleFormat
- type SubtitleOperation
- type SubtitleStreamInfo
- type SubtitleTrack
- type ThumbnailFormat
- type ThumbnailMode
- type ThumbnailSpec
- type ToneMapping
- type UpdateWebhookConfig
- type UploadCompleteParams
- type UploadCreateParams
- type UploadPart
- type UsageSummary
- type User
- type UserListParams
- type UserOrganization
- type UserUpdateMeParams
- type UserWithOrganizations
- type Users
- func (u *Users) Get(ctx context.Context, id string) (*User, error)
- func (u *Users) GetMe(ctx context.Context) (*UserWithOrganizations, error)
- func (u *Users) List(ctx context.Context, params *UserListParams) *Iter[*User]
- func (u *Users) UpdateMe(ctx context.Context, params *UserUpdateMeParams) (*User, error)
- type VP9Options
- type ValidationResult
- type VariantPricingSnapshot
- type Video
- type VideoCodec
- type VideoListParams
- type VideoRendition
- type VideoSettings
- type VideoStatus
- type VideoStreamInfo
- type VideoUpdateParams
- type VideoVariant
- type VideoVisibility
- type Videos
- func (v *Videos) AbortMultipartUpload(ctx context.Context, params *MultipartAbortParams) error
- func (v *Videos) CompleteMultipartUpload(ctx context.Context, params *MultipartCompleteParams) (*Video, error)
- func (v *Videos) CompleteUpload(ctx context.Context, params *UploadCompleteParams) (*Video, error)
- func (v *Videos) CreateMultipartUpload(ctx context.Context, params *MultipartCreateParams) (*v1.CreateMultipartUploadResponse, error)
- func (v *Videos) CreateUpload(ctx context.Context, params *UploadCreateParams) (*v1.CreateUploadResponse, error)
- func (v *Videos) Delete(ctx context.Context, id string) error
- func (v *Videos) Get(ctx context.Context, id string) (*Video, error)
- func (v *Videos) GetUploadPartURLs(ctx context.Context, params *MultipartPartURLsParams) (*v1.GetUploadPartUrlsResponse, error)
- func (v *Videos) GetUsage(ctx context.Context, billingMonth string) (*UsageSummary, error)
- func (v *Videos) List(ctx context.Context, params *VideoListParams) *Iter[*Video]
- func (v *Videos) Update(ctx context.Context, params *VideoUpdateParams) (*Video, error)
- func (v *Videos) Watch(ctx context.Context, id string) *Stream[*WatchVideoResponse]
- type WatchEventType
- type WatchJobResponse
- type WatchVideoResponse
- type WebhookConfig
Constants ¶
const ( MembershipRoleOwner = v1.MembershipRole_MEMBERSHIP_ROLE_OWNER MembershipRoleAdmin = v1.MembershipRole_MEMBERSHIP_ROLE_ADMIN MembershipRoleMember = v1.MembershipRole_MEMBERSHIP_ROLE_MEMBER MembershipRoleViewer = v1.MembershipRole_MEMBERSHIP_ROLE_VIEWER )
const ( JobStatusUnspecified = v1.JobStatus_JOB_STATUS_UNSPECIFIED JobStatusPending = v1.JobStatus_JOB_STATUS_PENDING JobStatusProbing = v1.JobStatus_JOB_STATUS_PROBING JobStatusProcessing = v1.JobStatus_JOB_STATUS_PROCESSING JobStatusCompleted = v1.JobStatus_JOB_STATUS_COMPLETED JobStatusFailed = v1.JobStatus_JOB_STATUS_FAILED JobStatusCanceled = v1.JobStatus_JOB_STATUS_CANCELED JobStatusPartial = v1.JobStatus_JOB_STATUS_PARTIAL JobStatusAwaitingConfirmation = v1.JobStatus_JOB_STATUS_AWAITING_CONFIRMATION )
JobStatus values.
const ( JobPriorityEconomy = v1.JobPriority_JOB_PRIORITY_ECONOMY JobPriorityStandard = v1.JobPriority_JOB_PRIORITY_STANDARD JobPriorityPremium = v1.JobPriority_JOB_PRIORITY_PREMIUM )
JobPriority values.
const ( OutputStatusPending = v1.OutputStatus_OUTPUT_STATUS_PENDING OutputStatusProcessing = v1.OutputStatus_OUTPUT_STATUS_PROCESSING OutputStatusCompleted = v1.OutputStatus_OUTPUT_STATUS_COMPLETED OutputStatusFailed = v1.OutputStatus_OUTPUT_STATUS_FAILED OutputStatusCanceled = v1.OutputStatus_OUTPUT_STATUS_CANCELED )
OutputStatus values.
const ( OutputFormatMP4 = v1.OutputFormat_OUTPUT_FORMAT_MP4 OutputFormatWebM = v1.OutputFormat_OUTPUT_FORMAT_WEBM OutputFormatMKV = v1.OutputFormat_OUTPUT_FORMAT_MKV OutputFormatMOV = v1.OutputFormat_OUTPUT_FORMAT_MOV OutputFormatHLS = v1.OutputFormat_OUTPUT_FORMAT_HLS OutputFormatDASH = v1.OutputFormat_OUTPUT_FORMAT_DASH OutputFormatAdaptive = v1.OutputFormat_OUTPUT_FORMAT_ADAPTIVE )
OutputFormat values.
const ( VideoCodecH264 = v1.VideoCodec_VIDEO_CODEC_H264 VideoCodecH265 = v1.VideoCodec_VIDEO_CODEC_H265 VideoCodecVP9 = v1.VideoCodec_VIDEO_CODEC_VP9 VideoCodecAV1 = v1.VideoCodec_VIDEO_CODEC_AV1 )
VideoCodec values.
const ( AudioCodecAAC = v1.AudioCodec_AUDIO_CODEC_AAC AudioCodecOpus = v1.AudioCodec_AUDIO_CODEC_OPUS AudioCodecMP3 = v1.AudioCodec_AUDIO_CODEC_MP3 )
AudioCodec values.
const ( ContainerMP4 = v1.Container_CONTAINER_MP4 ContainerWebM = v1.Container_CONTAINER_WEBM ContainerMKV = v1.Container_CONTAINER_MKV ContainerTS = v1.Container_CONTAINER_TS ContainerMOV = v1.Container_CONTAINER_MOV )
Container values.
const ( Resolution480P = v1.Resolution_RESOLUTION_480P Resolution720P = v1.Resolution_RESOLUTION_720P Resolution1080P = v1.Resolution_RESOLUTION_1080P Resolution1440P = v1.Resolution_RESOLUTION_1440P Resolution2160P = v1.Resolution_RESOLUTION_2160P Resolution4320P = v1.Resolution_RESOLUTION_4320P )
Resolution values.
const ( QualityTierEconomy = v1.QualityTier_QUALITY_TIER_ECONOMY QualityTierStandard = v1.QualityTier_QUALITY_TIER_STANDARD QualityTierPremium = v1.QualityTier_QUALITY_TIER_PREMIUM )
QualityTier values.
const ( ContentTypeFilm = v1.ContentType_CONTENT_TYPE_FILM ContentTypeAnimation = v1.ContentType_CONTENT_TYPE_ANIMATION ContentTypeGrain = v1.ContentType_CONTENT_TYPE_GRAIN ContentTypeGaming = v1.ContentType_CONTENT_TYPE_GAMING ContentTypeSports = v1.ContentType_CONTENT_TYPE_SPORTS ContentTypeStillImage = v1.ContentType_CONTENT_TYPE_STILLIMAGE )
ContentType values (encoder hint — what kind of source you're feeding it).
const ( DeliveryFormatProgressive = v1.DeliveryFormat_DELIVERY_FORMAT_PROGRESSIVE DeliveryFormatHLS = v1.DeliveryFormat_DELIVERY_FORMAT_HLS DeliveryFormatDASH = v1.DeliveryFormat_DELIVERY_FORMAT_DASH DeliveryFormatCMAF = v1.DeliveryFormat_DELIVERY_FORMAT_CMAF )
DeliveryFormat values.
const ( BitrateModeCRF = v1.BitrateMode_BITRATE_MODE_CRF BitrateModeCBR = v1.BitrateMode_BITRATE_MODE_CBR BitrateModeVBR = v1.BitrateMode_BITRATE_MODE_VBR )
BitrateMode values.
const ( WatchEventSnapshot = v1.WatchEventType_WATCH_EVENT_TYPE_SNAPSHOT WatchEventProgress = v1.WatchEventType_WATCH_EVENT_TYPE_PROGRESS WatchEventStatusChange = v1.WatchEventType_WATCH_EVENT_TYPE_STATUS_CHANGE WatchEventCompleted = v1.WatchEventType_WATCH_EVENT_TYPE_COMPLETED WatchEventHeartbeat = v1.WatchEventType_WATCH_EVENT_TYPE_HEARTBEAT )
WatchEventType values.
const ( DRMSystemWidevine = v1.DRMSystem_DRM_SYSTEM_WIDEVINE DRMSystemFairPlay = v1.DRMSystem_DRM_SYSTEM_FAIRPLAY DRMSystemPlayReady = v1.DRMSystem_DRM_SYSTEM_PLAYREADY )
DRMSystem values.
const ( EncryptionSchemeCENC = v1.EncryptionScheme_ENCRYPTION_SCHEME_CENC EncryptionSchemeCBCS = v1.EncryptionScheme_ENCRYPTION_SCHEME_CBCS )
EncryptionScheme values.
const ( HDRFormatHDR10 = v1.HDRFormat_HDR_FORMAT_HDR10 HDRFormatHDR10Plus = v1.HDRFormat_HDR_FORMAT_HDR10_PLUS HDRFormatHLG = v1.HDRFormat_HDR_FORMAT_HLG HDRFormatDolbyVision5 = v1.HDRFormat_HDR_FORMAT_DOLBY_VISION_5 HDRFormatDolbyVision8 = v1.HDRFormat_HDR_FORMAT_DOLBY_VISION_8 )
HDRFormat values.
const ( HDRModePassthrough = v1.HDRMode_HDR_MODE_PASSTHROUGH HDRModeTonemap = v1.HDRMode_HDR_MODE_TONEMAP HDRModeForce = v1.HDRMode_HDR_MODE_FORCE )
HDRMode values.
const ( ToneMappingReinhard = v1.ToneMapping_TONE_MAPPING_REINHARD ToneMappingHable = v1.ToneMapping_TONE_MAPPING_HABLE ToneMappingBT2390 = v1.ToneMapping_TONE_MAPPING_BT2390 ToneMappingMobius = v1.ToneMapping_TONE_MAPPING_MOBIUS )
ToneMapping values.
const ( ContentAwareModePerTitle = v1.ContentAwareMode_CONTENT_AWARE_MODE_PER_TITLE ContentAwareModeAutoABR = v1.ContentAwareMode_CONTENT_AWARE_MODE_AUTO_ABR )
ContentAwareMode values.
const ( SubtitleOpPassthrough = v1.SubtitleOperation_SUBTITLE_OPERATION_PASSTHROUGH SubtitleOpConvert = v1.SubtitleOperation_SUBTITLE_OPERATION_CONVERT SubtitleOpBurnIn = v1.SubtitleOperation_SUBTITLE_OPERATION_BURN_IN SubtitleOpExtract = v1.SubtitleOperation_SUBTITLE_OPERATION_EXTRACT )
SubtitleOperation values.
const ( SubtitleFormatSRT = v1.SubtitleFormat_SUBTITLE_FORMAT_SRT SubtitleFormatWebVTT = v1.SubtitleFormat_SUBTITLE_FORMAT_WEBVTT SubtitleFormatTTML = v1.SubtitleFormat_SUBTITLE_FORMAT_TTML SubtitleFormatASS = v1.SubtitleFormat_SUBTITLE_FORMAT_ASS )
SubtitleFormat values.
const ( ThumbnailModeSingle = v1.ThumbnailMode_THUMBNAIL_MODE_SINGLE ThumbnailModeInterval = v1.ThumbnailMode_THUMBNAIL_MODE_INTERVAL ThumbnailModeSprite = v1.ThumbnailMode_THUMBNAIL_MODE_SPRITE ThumbnailModeTimestamps = v1.ThumbnailMode_THUMBNAIL_MODE_TIMESTAMPS )
ThumbnailMode values.
const ( ThumbnailFormatJPEG = v1.ThumbnailFormat_THUMBNAIL_FORMAT_JPEG ThumbnailFormatPNG = v1.ThumbnailFormat_THUMBNAIL_FORMAT_PNG ThumbnailFormatWebP = v1.ThumbnailFormat_THUMBNAIL_FORMAT_WEBP )
ThumbnailFormat values.
const ( HLSSegmentFMP4 = v1.HLSSegmentFormat_HLS_SEGMENT_FORMAT_FMP4 HLSSegmentTS = v1.HLSSegmentFormat_HLS_SEGMENT_FORMAT_TS )
HLSSegmentFormat values.
const ( HLSPlaylistVOD = v1.HLSPlaylistType_HLS_PLAYLIST_TYPE_VOD HLSPlaylistEvent = v1.HLSPlaylistType_HLS_PLAYLIST_TYPE_EVENT )
HLSPlaylistType values.
const ( GOPAlignmentAligned = v1.GOPAlignmentMode_GOP_ALIGNMENT_MODE_ALIGNED GOPAlignmentFixed = v1.GOPAlignmentMode_GOP_ALIGNMENT_MODE_FIXED )
GOPAlignmentMode values.
const ( OriginProviderGCS = v1.OriginProvider_ORIGIN_PROVIDER_GCS OriginProviderS3 = v1.OriginProvider_ORIGIN_PROVIDER_S3 OriginProviderHTTP = v1.OriginProvider_ORIGIN_PROVIDER_HTTP OriginProviderTranscodely = v1.OriginProvider_ORIGIN_PROVIDER_TRANSCODELY )
OriginProvider values.
const ( OriginPermissionRead = v1.OriginPermission_ORIGIN_PERMISSION_READ OriginPermissionWrite = v1.OriginPermission_ORIGIN_PERMISSION_WRITE )
OriginPermission values.
const ( OriginStatusActive = v1.OriginStatus_ORIGIN_STATUS_ACTIVE OriginStatusFailed = v1.OriginStatus_ORIGIN_STATUS_FAILED OriginStatusArchived = v1.OriginStatus_ORIGIN_STATUS_ARCHIVED )
OriginStatus values.
const ( VideoStatusUploading = v1.VideoStatus_VIDEO_STATUS_UPLOADING VideoStatusProcessing = v1.VideoStatus_VIDEO_STATUS_PROCESSING VideoStatusReady = v1.VideoStatus_VIDEO_STATUS_READY VideoStatusError = v1.VideoStatus_VIDEO_STATUS_ERROR VideoStatusArchived = v1.VideoStatus_VIDEO_STATUS_ARCHIVED VideoStatusDeleted = v1.VideoStatus_VIDEO_STATUS_DELETED )
VideoStatus values.
const ( VideoVisibilityPublic = v1.VideoVisibility_VIDEO_VISIBILITY_PUBLIC VideoVisibilityUnlisted = v1.VideoVisibility_VIDEO_VISIBILITY_UNLISTED VideoVisibilityPrivate = v1.VideoVisibility_VIDEO_VISIBILITY_PRIVATE )
VideoVisibility values.
const APIVersion = "2026-05-03"
APIVersion is the calendar version of the Transcodely API the SDK targets. Sent as the `Transcodely-Version` header on every request.
const DefaultBaseURL = "https://api.transcodely.com"
DefaultBaseURL is the production API endpoint.
const Version = "0.1.1" // x-release-please-version
Version is the semantic version of the Transcodely Go SDK.
Variables ¶
var ErrMissingAPIKey = errors.New("transcodely: api key is required")
ErrMissingAPIKey is returned by New when no API key is supplied.
Functions ¶
This section is empty.
Types ¶
type APIConnectionError ¶
type APIConnectionError struct {
// contains filtered or unexported fields
}
APIConnectionError indicates a network failure: DNS resolution, TLS handshake, connection refused, no HTTP response received.
func (*APIConnectionError) Errors ¶
func (e *APIConnectionError) Errors() []FieldViolation
func (*APIConnectionError) HTTPStatus ¶
func (e *APIConnectionError) HTTPStatus() int
type APIError ¶
type APIError struct {
// contains filtered or unexported fields
}
APIError indicates a server-side internal error (5xx).
func (*APIError) Errors ¶
func (e *APIError) Errors() []FieldViolation
func (*APIError) HTTPStatus ¶
func (e *APIError) HTTPStatus() int
type APIKeyCreateParams ¶
type APIKeyCreateParams = v1.CreateAPIKeyRequest
type APIKeyListParams ¶
type APIKeyListParams = v1.ListAPIKeysRequest
type APIKeys ¶
type APIKeys struct {
// contains filtered or unexported fields
}
APIKeys is the Stripe-style namespace for API keys.
func (*APIKeys) Create ¶
func (a *APIKeys) Create(ctx context.Context, params *APIKeyCreateParams) (*CreatedAPIKey, error)
Create issues a new API key. The plaintext secret is only available once, in the returned CreatedAPIKey — store it immediately.
type AV1Options ¶
type AV1Options = v1.AV1Options
type AppCreateParams ¶
type AppCreateParams = v1.CreateAppRequest
type AppListParams ¶
type AppListParams = v1.ListAppsRequest
type AppUpdateParams ¶
type AppUpdateParams = v1.UpdateAppRequest
type Apps ¶
type Apps struct {
// contains filtered or unexported fields
}
Apps is the Stripe-style namespace for application scopes within an org.
func (*Apps) EnableHosting ¶
EnableHosting turns on the managed hosting experience for an app.
func (*Apps) UpdateHostingConfig ¶
func (a *Apps) UpdateHostingConfig(ctx context.Context, params *v1.UpdateHostingConfigRequest) (*App, error)
UpdateHostingConfig mutates the managed-hosting configuration of an app.
type AudioCodec ¶
type AudioCodec = v1.AudioCodec
type AudioSettings ¶
type AudioSettings = v1.AudioSettings
type AudioStreamInfo ¶
type AudioStreamInfo = v1.AudioStreamInfo
type AudioTrackConfig ¶
type AudioTrackConfig = v1.AudioTrackConfig
type AuthenticationError ¶
type AuthenticationError struct {
// contains filtered or unexported fields
}
AuthenticationError indicates a 401: missing, invalid, revoked or expired API key.
func (*AuthenticationError) Errors ¶
func (e *AuthenticationError) Errors() []FieldViolation
func (*AuthenticationError) HTTPStatus ¶
func (e *AuthenticationError) HTTPStatus() int
type AutoABRConfig ¶
type AutoABRConfig = v1.AutoABRConfig
type AutoProfileDefaults ¶
type AutoProfileDefaults = v1.AutoProfileDefaults
type BYOKConfig ¶
type BYOKConfig = v1.BYOKConfig
type BitrateMode ¶
type BitrateMode = v1.BitrateMode
type BurnInStyle ¶
type BurnInStyle = v1.BurnInStyle
type Client ¶
type Client struct {
Jobs *Jobs
Videos *Videos
Presets *Presets
Origins *Origins
Apps *Apps
APIKeys *APIKeys
Organizations *Organizations
Memberships *Memberships
Users *Users
Health *Health
// contains filtered or unexported fields
}
Client is the root Transcodely API client. Construct one with New, then reach the resource you need via the typed namespace fields.
A *Client is safe for concurrent use by multiple goroutines and is meant to live for the lifetime of your process. The underlying *http.Client is shared across every RPC and connection-pools transparently.
type CompletedPart ¶
type CompletedPart = v1.CompletedPart
type ComponentHealth ¶
type ComponentHealth = v1.ComponentHealth
type ConflictError ¶
type ConflictError struct {
// contains filtered or unexported fields
}
ConflictError indicates a 409: already exists, idempotency conflict, slug taken.
func (*ConflictError) Errors ¶
func (e *ConflictError) Errors() []FieldViolation
func (*ConflictError) HTTPStatus ¶
func (e *ConflictError) HTTPStatus() int
type ContentAnalysis ¶
type ContentAnalysis = v1.ContentAnalysis
type ContentAwareConfig ¶
type ContentAwareConfig = v1.ContentAwareConfig
type ContentAwareMode ¶
type ContentAwareMode = v1.ContentAwareMode
type ContentType ¶
type ContentType = v1.ContentType
type CreateWebhookConfig ¶
type CreateWebhookConfig = v1.CreateWebhookConfig
type CreatedAPIKey ¶
CreatedAPIKey wraps a freshly created key with its one-time-visible secret.
type DASHConfig ¶
type DASHConfig = v1.DASHConfig
type DeliveryFormat ¶
type DeliveryFormat = v1.DeliveryFormat
type EncryptionScheme ¶
type EncryptionScheme = v1.EncryptionScheme
type Error ¶
type Error interface {
error
// Code is the server-side machine-readable code (e.g. "JOB_NOT_FOUND").
ErrorCode() string
// RequestID is the `req_*` identifier the server returned in `X-Request-Id`,
// or the empty string if absent.
RequestID() string
}
Error is the base interface implemented by every typed error the SDK returns.
All concrete error types (*APIConnectionError, *APIError, *AuthenticationError, *PermissionError, *NotFoundError, *ConflictError, *RateLimitError, *InvalidRequestError, *PreconditionError) embed *baseError, so a single errors.As(err, &target) check is enough for typed handling.
type ErrorDetails ¶
type ErrorDetails = v1.ErrorDetails
type ExecutionTiming ¶
type ExecutionTiming = v1.ExecutionTiming
type FieldViolation ¶
FieldViolation describes a single field-level validation failure.
type GOPAlignmentMode ¶
type GOPAlignmentMode = v1.GOPAlignmentMode
type GcsCredentials ¶
type GcsCredentials = v1.GcsCredentials
type GcsOriginConfig ¶
type GcsOriginConfig = v1.GcsOriginConfig
type H264Options ¶
type H264Options = v1.H264Options
type H265Options ¶
type H265Options = v1.H265Options
type HLSPlaylistType ¶
type HLSPlaylistType = v1.HLSPlaylistType
type HLSSegmentFormat ¶
type HLSSegmentFormat = v1.HLSSegmentFormat
type Health ¶
type Health struct {
// contains filtered or unexported fields
}
Health is the Stripe-style namespace for liveness checks.
type HealthCheckResponse ¶
type HealthCheckResponse = v1.HealthCheckResponse
type HostingConfig ¶
type HostingConfig = v1.HostingConfig
type HttpCredentials ¶
type HttpCredentials = v1.HttpCredentials
type HttpOriginConfig ¶
type HttpOriginConfig = v1.HttpOriginConfig
type InputMetadata ¶
type InputMetadata = v1.InputMetadata
type InvalidRequestError ¶
type InvalidRequestError struct {
// contains filtered or unexported fields
}
InvalidRequestError indicates a 400/422: request body or parameters invalid. Errors() returns the per-field violations from the server.
func (*InvalidRequestError) Errors ¶
func (e *InvalidRequestError) Errors() []FieldViolation
func (*InvalidRequestError) HTTPStatus ¶
func (e *InvalidRequestError) HTTPStatus() int
type Iter ¶
type Iter[T any] struct { // contains filtered or unexported fields }
Iter is the iterator returned by every List* method. It transparently fetches further pages on demand so callers can write a single for-loop:
iter := client.Jobs.List(ctx, &transcodely.JobListParams{Limit: 50})
for iter.Next() {
job := iter.Current()
// ...
}
if err := iter.Err(); err != nil {
// ...
}
To bound iteration, break out of the loop or call Close.
func (*Iter[T]) Close ¶
Close releases iterator state. The current implementation is a no-op (HTTP connections close automatically), but you should still defer Close so the signature is stable across future versions.
func (*Iter[T]) Current ¶
func (it *Iter[T]) Current() T
Current returns the most recent item produced by Next. Calling Current before Next has returned true is undefined.
type JobCreateParams ¶
type JobCreateParams = v1.CreateJobRequest
type JobListParams ¶
type JobListParams = v1.ListJobsRequest
type JobPriority ¶
type JobPriority = v1.JobPriority
type Jobs ¶
type Jobs struct {
// contains filtered or unexported fields
}
Jobs is the Stripe-style namespace for transcoding jobs. Reach it via client.Jobs.
func (*Jobs) Confirm ¶
Confirm starts a job currently in AWAITING_CONFIRMATION (created with delay_start = true). Returns the job in PROCESSING state.
func (*Jobs) Create ¶
Create submits a new transcoding job. If params.IdempotencyKey is empty, the SDK auto-generates one so retried calls are server-side deduped.
type KeyServerConfig ¶
type KeyServerConfig = v1.KeyServerConfig
type Membership ¶
type Membership = v1.Membership
type MembershipListParams ¶
type MembershipListParams = v1.ListMembershipsRequest
type MembershipRole ¶
type MembershipRole = v1.MembershipRole
MembershipRole values (re-exported here for proximity).
type MembershipWithUser ¶
type MembershipWithUser = v1.MembershipWithUser
type Memberships ¶
type Memberships struct {
// contains filtered or unexported fields
}
Memberships is the Stripe-style namespace for org memberships.
func (*Memberships) Get ¶
func (m *Memberships) Get(ctx context.Context, id string) (*MembershipWithUser, error)
Get fetches a membership by ID (`mem_*`). The result includes the linked user.
func (*Memberships) List ¶
func (m *Memberships) List(ctx context.Context, params *MembershipListParams) *Iter[*MembershipWithUser]
List returns an iterator over memberships within the active organization. Items include the linked user via MembershipWithUser.
func (*Memberships) Remove ¶
func (m *Memberships) Remove(ctx context.Context, id string) error
Remove deletes a membership.
func (*Memberships) UpdateRole ¶
func (m *Memberships) UpdateRole(ctx context.Context, id string, role MembershipRole) (*Membership, error)
UpdateRole changes a member's role.
type MultipartAbortParams ¶
type MultipartAbortParams = v1.AbortMultipartUploadRequest
type MultipartCompleteParams ¶
type MultipartCompleteParams = v1.CompleteMultipartUploadRequest
type MultipartCreateParams ¶
type MultipartCreateParams = v1.CreateMultipartUploadRequest
type MultipartPartURLsParams ¶
type MultipartPartURLsParams = v1.GetUploadPartUrlsRequest
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError indicates a 404: the requested resource was not found.
func (*NotFoundError) Errors ¶
func (e *NotFoundError) Errors() []FieldViolation
func (*NotFoundError) HTTPStatus ¶
func (e *NotFoundError) HTTPStatus() int
type Option ¶
type Option func(*config)
Option configures a Client. Options are applied in order; later options override earlier ones.
func WithAPIVersion ¶
WithAPIVersion overrides the calendar API version sent in the Transcodely-Version header. You should rarely need this — the SDK pins a version known to be compatible with its types.
func WithAutoIdempotency ¶
WithAutoIdempotency toggles automatic Idempotency-Key generation on POST mutations. Defaults to true.
func WithBaseURL ¶
WithBaseURL overrides the API base URL. Defaults to DefaultBaseURL. Useful for staging, local docker-compose, or self-hosted deployments.
func WithHTTPClient ¶
WithHTTPClient supplies a custom *http.Client. Useful for injecting a shared transport, custom timeouts, proxy configuration, or test stubs.
func WithMaxRetries ¶
WithMaxRetries sets how many times the SDK retries a transient failure (network errors, 5xx, 429, 503) before giving up. Defaults to 2. Set to 0 to disable retries.
func WithUserAgent ¶
WithUserAgent appends a token to the default user-agent string. Use this to identify your application: WithUserAgent("acme-encoder/1.4.2").
type OrgCreateParams ¶
type OrgCreateParams = v1.CreateOrganizationRequest
type OrgListParams ¶
type OrgListParams = v1.ListOrganizationsRequest
type OrgUpdateParams ¶
type OrgUpdateParams = v1.UpdateOrganizationRequest
type Organization ¶
type Organization = v1.Organization
type Organizations ¶
type Organizations struct {
// contains filtered or unexported fields
}
Organizations is the Stripe-style namespace for organizations.
func (*Organizations) CheckSlug ¶
func (o *Organizations) CheckSlug(ctx context.Context, slug string) (*SlugCheckResult, error)
CheckSlug reports whether a candidate slug is free.
func (*Organizations) Create ¶
func (o *Organizations) Create(ctx context.Context, params *OrgCreateParams) (*Organization, error)
Create provisions a new organization. The caller becomes its first owner.
func (*Organizations) Get ¶
func (o *Organizations) Get(ctx context.Context, idOrSlug string) (*Organization, error)
Get fetches an organization by ID (`org_*`) or slug.
func (*Organizations) List ¶
func (o *Organizations) List(ctx context.Context, params *OrgListParams) *Iter[*Organization]
List returns an iterator over organizations the caller can see.
func (*Organizations) Update ¶
func (o *Organizations) Update(ctx context.Context, params *OrgUpdateParams) (*Organization, error)
Update mutates organization metadata.
type OriginCreateParams ¶
type OriginCreateParams = v1.CreateOriginRequest
type OriginListParams ¶
type OriginListParams = v1.ListOriginsRequest
type OriginPermission ¶
type OriginPermission = v1.OriginPermission
type OriginProvider ¶
type OriginProvider = v1.OriginProvider
type OriginStatus ¶
type OriginStatus = v1.OriginStatus
type OriginUpdateParams ¶
type OriginUpdateParams = v1.UpdateOriginRequest
type Origins ¶
type Origins struct {
// contains filtered or unexported fields
}
Origins is the Stripe-style namespace for storage origins (GCS, S3, HTTP).
type OutputFormat ¶
type OutputFormat = v1.OutputFormat
type OutputSpec ¶
type OutputSpec = v1.OutputSpec
type OutputStatus ¶
type OutputStatus = v1.OutputStatus
type PaginationRequest ¶
type PaginationRequest = v1.PaginationRequest
type PaginationResponse ¶
type PaginationResponse = v1.PaginationResponse
type PermissionError ¶
type PermissionError struct {
// contains filtered or unexported fields
}
PermissionError indicates a 403: authenticated but lacking permission.
func (*PermissionError) Errors ¶
func (e *PermissionError) Errors() []FieldViolation
func (*PermissionError) HTTPStatus ¶
func (e *PermissionError) HTTPStatus() int
type PreconditionError ¶
type PreconditionError struct {
// contains filtered or unexported fields
}
PreconditionError indicates a 412: preconditions not met (e.g. job not cancelable in current state).
func (*PreconditionError) Errors ¶
func (e *PreconditionError) Errors() []FieldViolation
func (*PreconditionError) HTTPStatus ¶
func (e *PreconditionError) HTTPStatus() int
type PresetCreateParams ¶
type PresetCreateParams = v1.CreatePresetRequest
type PresetListParams ¶
type PresetListParams = v1.ListPresetsRequest
type PresetUpdateParams ¶
type PresetUpdateParams = v1.UpdatePresetRequest
type PresetVariant ¶
type PresetVariant = v1.PresetVariant
type Presets ¶
type Presets struct {
// contains filtered or unexported fields
}
Presets is the Stripe-style namespace for reusable transcoding presets.
func (*Presets) Archive ¶
Archive soft-deletes a preset. Existing jobs that reference it continue to run; future job creations are rejected.
func (*Presets) Duplicate ¶
Duplicate copies an existing preset under a new slug + name. Both are required.
type PricingSnapshot ¶
type PricingSnapshot = v1.PricingSnapshot
type ProtoFieldViolation ¶
type ProtoFieldViolation = v1.FieldViolation
type QualityTier ¶
type QualityTier = v1.QualityTier
type RateLimitError ¶
RateLimitError indicates a 429: quota or rate limit exceeded. RetryAfter reflects the `Retry-After` response header.
func (*RateLimitError) Errors ¶
func (e *RateLimitError) Errors() []FieldViolation
func (*RateLimitError) HTTPStatus ¶
func (e *RateLimitError) HTTPStatus() int
type Resolution ¶
type Resolution = v1.Resolution
type S3Credentials ¶
type S3Credentials = v1.S3Credentials
type S3OriginConfig ¶
type S3OriginConfig = v1.S3OriginConfig
type SegmentConfig ¶
type SegmentConfig = v1.SegmentConfig
type SlugCheckResult ¶
SlugCheckResult describes the outcome of a slug availability check.
type Stream ¶
type Stream[T any] struct { // contains filtered or unexported fields }
Stream is the iterator returned by Watch RPCs. It auto-reconnects on transient network failures up to (max retries) times, transparently filters server heartbeats, and surfaces a single typed error via Err().
stream := client.Jobs.Watch(ctx, jobID)
defer stream.Close()
for stream.Next() {
event := stream.Current()
// ...
}
if err := stream.Err(); err != nil {
// ...
}
func (*Stream[T]) Close ¶
Close cancels the underlying request and releases resources. Safe to call multiple times.
func (*Stream[T]) Current ¶
func (s *Stream[T]) Current() T
Current returns the most recently received event.
type StreamingConfig ¶
type StreamingConfig = v1.StreamingConfig
type SubtitleFormat ¶
type SubtitleFormat = v1.SubtitleFormat
type SubtitleOperation ¶
type SubtitleOperation = v1.SubtitleOperation
type SubtitleStreamInfo ¶
type SubtitleStreamInfo = v1.SubtitleStreamInfo
type SubtitleTrack ¶
type SubtitleTrack = v1.SubtitleTrack
type ThumbnailFormat ¶
type ThumbnailFormat = v1.ThumbnailFormat
type ThumbnailMode ¶
type ThumbnailMode = v1.ThumbnailMode
type ThumbnailSpec ¶
type ThumbnailSpec = v1.ThumbnailSpec
type ToneMapping ¶
type ToneMapping = v1.ToneMapping
type UpdateWebhookConfig ¶
type UpdateWebhookConfig = v1.UpdateWebhookConfig
type UploadCompleteParams ¶
type UploadCompleteParams = v1.CompleteUploadRequest
type UploadCreateParams ¶
type UploadCreateParams = v1.CreateUploadRequest
type UploadPart ¶
type UploadPart = v1.UploadPart
type UsageSummary ¶
type UsageSummary = v1.UsageSummary
type UserListParams ¶
type UserListParams = v1.ListUsersRequest
type UserOrganization ¶
type UserOrganization = v1.UserOrganization
type UserUpdateMeParams ¶
type UserUpdateMeParams = v1.UpdateMeRequest
type UserWithOrganizations ¶
type UserWithOrganizations = v1.UserWithOrganizations
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users is the Stripe-style namespace for user accounts.
func (*Users) GetMe ¶
func (u *Users) GetMe(ctx context.Context) (*UserWithOrganizations, error)
GetMe returns the user identified by the current API key, including the organizations they belong to.
type VP9Options ¶
type VP9Options = v1.VP9Options
type ValidationResult ¶
type ValidationResult = v1.ValidationResult
type VariantPricingSnapshot ¶
type VariantPricingSnapshot = v1.VariantPricingSnapshot
type VideoCodec ¶
type VideoCodec = v1.VideoCodec
type VideoListParams ¶
type VideoListParams = v1.ListVideosRequest
type VideoRendition ¶
type VideoRendition = v1.VideoRendition
type VideoSettings ¶
type VideoSettings = v1.VideoSettings
type VideoStatus ¶
type VideoStatus = v1.VideoStatus
type VideoStreamInfo ¶
type VideoStreamInfo = v1.VideoStreamInfo
type VideoUpdateParams ¶
type VideoUpdateParams = v1.UpdateVideoRequest
type VideoVariant ¶
type VideoVariant = v1.VideoVariant
type VideoVisibility ¶
type VideoVisibility = v1.VideoVisibility
type Videos ¶
type Videos struct {
// contains filtered or unexported fields
}
Videos is the Stripe-style namespace for hosted videos and uploads. Reach it via client.Videos.
func (*Videos) AbortMultipartUpload ¶
func (v *Videos) AbortMultipartUpload(ctx context.Context, params *MultipartAbortParams) error
AbortMultipartUpload cancels an in-flight multipart upload and frees server-side state.
func (*Videos) CompleteMultipartUpload ¶
func (v *Videos) CompleteMultipartUpload(ctx context.Context, params *MultipartCompleteParams) (*Video, error)
CompleteMultipartUpload finalises a multipart upload. Pass the etags returned by S3 / GCS for each part.
func (*Videos) CompleteUpload ¶
CompleteUpload finalises a single-part upload. The video transitions to `processing` and a transcoding job is created automatically.
func (*Videos) CreateMultipartUpload ¶
func (v *Videos) CreateMultipartUpload(ctx context.Context, params *MultipartCreateParams) (*v1.CreateMultipartUploadResponse, error)
CreateMultipartUpload begins a multipart upload session.
func (*Videos) CreateUpload ¶
func (v *Videos) CreateUpload(ctx context.Context, params *UploadCreateParams) (*v1.CreateUploadResponse, error)
CreateUpload returns a presigned URL for uploading a single-part file. For files >100 MB, prefer CreateMultipartUpload instead.
func (*Videos) GetUploadPartURLs ¶
func (v *Videos) GetUploadPartURLs(ctx context.Context, params *MultipartPartURLsParams) (*v1.GetUploadPartUrlsResponse, error)
GetUploadPartURLs requests presigned URLs for the given part numbers.
func (*Videos) List ¶
List returns an iterator over videos. The Video service uses page-token pagination (PageSize / PageToken) rather than the cursor model.
type WatchEventType ¶
type WatchEventType = v1.WatchEventType
type WatchJobResponse ¶
type WatchJobResponse = v1.WatchJobResponse
type WatchVideoResponse ¶
type WatchVideoResponse = v1.WatchVideoResponse
type WebhookConfig ¶
type WebhookConfig = v1.WebhookConfig