Documentation
¶
Index ¶
- Variables
- type Authorization
- type Channel
- type EncryptionContractConfiguration
- type Handler
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type HarvestJob
- type HlsIngest
- type InMemoryBackend
- func (b *InMemoryBackend) AccountID() string
- func (b *InMemoryBackend) ConfigureLogs(id string, egressLogGroup, ingressLogGroup *string) (*Channel, error)
- func (b *InMemoryBackend) CreateChannel(id, description string, tags map[string]string) (*Channel, error)
- func (b *InMemoryBackend) CreateHarvestJob(id, originEndpointID, startTime, endTime string, s3Dest S3Destination) (*HarvestJob, error)
- func (b *InMemoryBackend) CreateOriginEndpoint(channelID, id, description, manifestName string, ...) (*OriginEndpoint, error)
- func (b *InMemoryBackend) DeleteChannel(id string) (*Channel, error)
- func (b *InMemoryBackend) DeleteOriginEndpoint(id string) (*OriginEndpoint, error)
- func (b *InMemoryBackend) DescribeChannel(id string) (*Channel, error)
- func (b *InMemoryBackend) DescribeHarvestJob(id string) (*HarvestJob, error)
- func (b *InMemoryBackend) DescribeOriginEndpoint(id string) (*OriginEndpoint, error)
- func (b *InMemoryBackend) ListChannels(maxResults int, nextToken string) ([]*Channel, string, error)
- func (b *InMemoryBackend) ListHarvestJobs(includeChannelID, includeStatus string, maxResults int, nextToken string) ([]*HarvestJob, string, error)
- func (b *InMemoryBackend) ListOriginEndpoints(channelID string, maxResults int, nextToken string) ([]*OriginEndpoint, string, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RotateChannelCredentials(id string) (*Channel, error)
- func (b *InMemoryBackend) RotateIngestEndpointCredentials(channelID, ingestEndpointID string) (*Channel, error)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
- func (b *InMemoryBackend) TaggedResources() []TaggedEntry
- func (b *InMemoryBackend) UntagResource(resourceARN string, keys []string) error
- func (b *InMemoryBackend) UpdateChannel(id, description string) (*Channel, error)
- func (b *InMemoryBackend) UpdateOriginEndpoint(id, description, manifestName string, ...) (*OriginEndpoint, error)
- type IngestEndpoint
- type MssEncryption
- type MssPackage
- type OriginEndpoint
- type PackagingConfig
- type Provider
- type S3Destination
- type SpekeKeyProvider
- type StorageBackend
- type StreamSelection
- type TaggedEntry
Constants ¶
This section is empty.
Variables ¶
var ErrConflict = awserr.New("UnprocessableEntityException", awserr.ErrAlreadyExists)
ErrConflict is returned for duplicate resource IDs.
var ErrInvalidParameter = awserr.New("UnprocessableEntityException", awserr.ErrInvalidParameter)
ErrInvalidParameter is returned for invalid input.
var ErrNilAppContext = errors.New("AppContext is required")
ErrNilAppContext is returned when Provider.Init is called with a nil AppContext.
var ErrNotFound = awserr.New("NotFoundException", awserr.ErrNotFound)
ErrNotFound is returned when a resource does not exist.
Functions ¶
This section is empty.
Types ¶
type Authorization ¶ added in v1.3.1
type Authorization struct {
CdnIdentifierSecret string `json:"cdnIdentifierSecret"`
SecretsRoleArn string `json:"secretsRoleArn"`
}
Authorization holds CDN-authorization credentials on an OriginEndpoint. Both fields are required together (types.Authorization, aws-sdk-go-v2/service/mediapackage@v1.42.4, types/types.go:10-26).
type Channel ¶
type Channel struct {
HlsIngest *HlsIngest
EgressLogGroupName *string
IngressLogGroupName *string
Tags map[string]string
ARN string
ID string
Description string
CreatedAt string
}
Channel represents a MediaPackage channel.
type EncryptionContractConfiguration ¶ added in v1.3.1
type EncryptionContractConfiguration struct {
PresetSpeke20Audio string `json:"presetSpeke20Audio"`
PresetSpeke20Video string `json:"presetSpeke20Video"`
}
EncryptionContractConfiguration selects SPEKE 2.0 audio/video encryption presets (types.EncryptionContractConfiguration, SDK types/types.go:246-259).
type Handler ¶
type Handler struct {
Backend StorageBackend
}
Handler handles MediaPackage HTTP requests.
func (*Handler) ExtractOperation ¶
ExtractOperation classifies the request into an operation name.
func (*Handler) ExtractResource ¶
ExtractResource returns the resource identifier from the request.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns all supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches MediaPackage requests by path and Authorization header. IoTAnalytics shares /channels paths, so we must distinguish by the service name embedded in the AWS Signature header.
type HarvestJob ¶
type HarvestJob struct {
S3Destination *S3Destination
ARN string
ChannelID string
CreatedAt string
EndTime string
ID string
OriginEndpointID string
StartTime string
Status string
}
HarvestJob represents a MediaPackage harvest job.
type HlsIngest ¶
type HlsIngest struct {
IngestEndpoints []*IngestEndpoint
}
HlsIngest holds a list of ingest endpoints for a channel.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is an in-memory implementation of StorageBackend.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new InMemoryBackend.
func (*InMemoryBackend) AccountID ¶
func (b *InMemoryBackend) AccountID() string
AccountID returns the configured AWS account ID.
func (*InMemoryBackend) ConfigureLogs ¶
func (b *InMemoryBackend) ConfigureLogs(id string, egressLogGroup, ingressLogGroup *string) (*Channel, error)
ConfigureLogs updates the egress/ingress log group configuration for a channel. A nil pointer means the caller did not send that egressAccessLogs/ingressAccessLogs block and leaves the existing configuration untouched, matching AWS's optional-member semantics.
func (*InMemoryBackend) CreateChannel ¶
func (b *InMemoryBackend) CreateChannel(id, description string, tags map[string]string) (*Channel, error)
CreateChannel creates a new MediaPackage channel.
func (*InMemoryBackend) CreateHarvestJob ¶
func (b *InMemoryBackend) CreateHarvestJob( id, originEndpointID, startTime, endTime string, s3Dest S3Destination, ) (*HarvestJob, error)
CreateHarvestJob creates a new harvest job record.
func (*InMemoryBackend) CreateOriginEndpoint ¶
func (b *InMemoryBackend) CreateOriginEndpoint( channelID, id, description, manifestName string, startoverWindowSeconds, timeDelaySeconds int, origination string, whitelist []string, tags map[string]string, pkg PackagingConfig, ) (*OriginEndpoint, error)
CreateOriginEndpoint creates a new origin endpoint.
func (*InMemoryBackend) DeleteChannel ¶
func (b *InMemoryBackend) DeleteChannel(id string) (*Channel, error)
DeleteChannel deletes a channel and all its origin endpoints.
func (*InMemoryBackend) DeleteOriginEndpoint ¶
func (b *InMemoryBackend) DeleteOriginEndpoint(id string) (*OriginEndpoint, error)
DeleteOriginEndpoint deletes an origin endpoint.
func (*InMemoryBackend) DescribeChannel ¶
func (b *InMemoryBackend) DescribeChannel(id string) (*Channel, error)
DescribeChannel returns a channel by ID.
func (*InMemoryBackend) DescribeHarvestJob ¶
func (b *InMemoryBackend) DescribeHarvestJob(id string) (*HarvestJob, error)
DescribeHarvestJob returns a harvest job by ID.
func (*InMemoryBackend) DescribeOriginEndpoint ¶
func (b *InMemoryBackend) DescribeOriginEndpoint(id string) (*OriginEndpoint, error)
DescribeOriginEndpoint returns an origin endpoint by ID.
func (*InMemoryBackend) ListChannels ¶
func (b *InMemoryBackend) ListChannels(maxResults int, nextToken string) ([]*Channel, string, error)
ListChannels returns a paginated list of channels sorted by ID.
func (*InMemoryBackend) ListHarvestJobs ¶
func (b *InMemoryBackend) ListHarvestJobs( includeChannelID, includeStatus string, maxResults int, nextToken string, ) ([]*HarvestJob, string, error)
ListHarvestJobs returns a paginated list of harvest jobs, optionally filtered by channel or status.
func (*InMemoryBackend) ListOriginEndpoints ¶
func (b *InMemoryBackend) ListOriginEndpoints( channelID string, maxResults int, nextToken string, ) ([]*OriginEndpoint, string, error)
ListOriginEndpoints returns a paginated list of origin endpoints.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
ListTagsForResource returns all tags for a resource.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the configured AWS region.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot.
func (*InMemoryBackend) RotateChannelCredentials ¶
func (b *InMemoryBackend) RotateChannelCredentials(id string) (*Channel, error)
RotateChannelCredentials changes the channel's first IngestEndpoint's username and password (this legacy API only ever touches ingestEndpoints[0] -- callers wanting to rotate a specific endpoint use RotateIngestEndpointCredentials instead). The endpoint's ID and URL are left unchanged; only the credentials are regenerated.
func (*InMemoryBackend) RotateIngestEndpointCredentials ¶
func (b *InMemoryBackend) RotateIngestEndpointCredentials(channelID, ingestEndpointID string) (*Channel, error)
RotateIngestEndpointCredentials rotates credentials for a specific ingest endpoint.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot returns a JSON-encoded snapshot of the backend state.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
TagResource adds or updates tags on a resource.
func (*InMemoryBackend) TaggedResources ¶ added in v1.3.1
func (b *InMemoryBackend) TaggedResources() []TaggedEntry
TaggedResources returns every MediaPackage resource ARN (channels and origin endpoints) that currently has at least one tag applied via TagResource.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceARN string, keys []string) error
UntagResource removes tags from a resource.
func (*InMemoryBackend) UpdateChannel ¶
func (b *InMemoryBackend) UpdateChannel(id, description string) (*Channel, error)
UpdateChannel updates a channel's description.
func (*InMemoryBackend) UpdateOriginEndpoint ¶
func (b *InMemoryBackend) UpdateOriginEndpoint( id, description, manifestName string, startoverWindowSeconds, timeDelaySeconds int, origination string, whitelist []string, pkg PackagingConfig, ) (*OriginEndpoint, error)
UpdateOriginEndpoint updates an origin endpoint's configuration.
type IngestEndpoint ¶
IngestEndpoint holds ingest URL and credentials for a channel.
type MssEncryption ¶ added in v1.3.1
type MssEncryption struct {
SpekeKeyProvider *SpekeKeyProvider `json:"spekeKeyProvider,omitempty"`
}
MssEncryption is the Microsoft Smooth Streaming encryption configuration (types.MssEncryption, SDK types/types.go:563-572).
type MssPackage ¶ added in v1.3.1
type MssPackage struct {
Encryption *MssEncryption `json:"encryption,omitempty"`
StreamSelection *StreamSelection `json:"streamSelection,omitempty"`
ManifestWindowSeconds int `json:"manifestWindowSeconds,omitempty"`
SegmentDurationSeconds int `json:"segmentDurationSeconds,omitempty"`
}
MssPackage is a Microsoft Smooth Streaming packaging configuration (types.MssPackage, SDK types/types.go:575-590).
type OriginEndpoint ¶
type OriginEndpoint struct {
Authorization *Authorization
MssPackage *MssPackage
CmafPackage map[string]any
DashPackage map[string]any
HlsPackage map[string]any
Tags map[string]string
ARN string
ChannelID string
ID string
Description string
ManifestName string
URL string
Origination string
CreatedAt string
Whitelist []string
StartoverWindowSeconds int
TimeDelaySeconds int
}
OriginEndpoint represents a MediaPackage origin endpoint.
type PackagingConfig ¶
type PackagingConfig struct {
Authorization *Authorization
CmafPackage map[string]any
DashPackage map[string]any
HlsPackage map[string]any
MssPackage *MssPackage
}
PackagingConfig holds the CDN-authorization credentials and per-protocol packaging blocks (HlsPackage/DashPackage/CmafPackage/MssPackage) accepted by CreateOriginEndpoint/UpdateOriginEndpoint. Authorization and MssPackage are modeled to their full real SDK shape (small enough: 2 and ~11 leaf fields respectively, no repeated sub-resources). HlsPackage/DashPackage/ CmafPackage remain an opaque passthrough -- each carries 12-16 leaf fields across several enum types, and CmafPackage additionally nests a *list* of HlsManifest sub-resources (~10 fields each); modeling those to the same full depth is a materially larger, separate unit of work (see PARITY.md). Every block is stored verbatim as the caller supplied it -- Describe/List echo back exactly what was configured.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the MediaPackage service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the MediaPackage backend and handler.
type S3Destination ¶
S3Destination describes where harvested content is exported.
type SpekeKeyProvider ¶ added in v1.3.1
type SpekeKeyProvider struct {
EncryptionContractConfiguration *EncryptionContractConfiguration `json:"encryptionContractConfiguration,omitempty"`
ResourceID string `json:"resourceId"`
RoleArn string `json:"roleArn"`
URL string `json:"url"`
CertificateArn string `json:"certificateArn,omitempty"`
SystemIDs []string `json:"systemIds"`
}
SpekeKeyProvider configures an external SPEKE key provider. ResourceID, RoleArn, SystemIDs, and URL are required together (types.SpekeKeyProvider, SDK types/types.go:681-721).
type StorageBackend ¶
type StorageBackend interface {
CreateChannel(id, description string, tags map[string]string) (*Channel, error)
DescribeChannel(id string) (*Channel, error)
UpdateChannel(id, description string) (*Channel, error)
DeleteChannel(id string) (*Channel, error)
ListChannels(maxResults int, nextToken string) ([]*Channel, string, error)
ConfigureLogs(id string, egressLogGroup, ingressLogGroup *string) (*Channel, error)
RotateChannelCredentials(id string) (*Channel, error)
RotateIngestEndpointCredentials(channelID, ingestEndpointID string) (*Channel, error)
CreateOriginEndpoint(
channelID, id, description, manifestName string,
startoverWindowSeconds, timeDelaySeconds int,
origination string,
whitelist []string,
tags map[string]string,
pkg PackagingConfig,
) (*OriginEndpoint, error)
DescribeOriginEndpoint(id string) (*OriginEndpoint, error)
UpdateOriginEndpoint(
id, description, manifestName string,
startoverWindowSeconds, timeDelaySeconds int,
origination string,
whitelist []string,
pkg PackagingConfig,
) (*OriginEndpoint, error)
DeleteOriginEndpoint(id string) (*OriginEndpoint, error)
ListOriginEndpoints(channelID string, maxResults int, nextToken string) ([]*OriginEndpoint, string, error)
CreateHarvestJob(id, originEndpointID, startTime, endTime string, s3Dest S3Destination) (*HarvestJob, error)
DescribeHarvestJob(id string) (*HarvestJob, error)
ListHarvestJobs(
includeChannelID, includeStatus string,
maxResults int,
nextToken string,
) ([]*HarvestJob, string, error)
TagResource(resourceARN string, tags map[string]string) error
UntagResource(resourceARN string, keys []string) error
ListTagsForResource(resourceARN string) (map[string]string, error)
AccountID() string
Region() string
Reset()
Snapshot(ctx context.Context) []byte
Restore(ctx context.Context, data []byte) error
}
StorageBackend is the interface for MediaPackage storage operations.
type StreamSelection ¶ added in v1.3.1
type StreamSelection struct {
StreamOrder string `json:"streamOrder,omitempty"`
MaxVideoBitsPerSecond int `json:"maxVideoBitsPerSecond,omitempty"`
MinVideoBitsPerSecond int `json:"minVideoBitsPerSecond,omitempty"`
}
StreamSelection filters/orders streams in packaged output (types.StreamSelection, SDK types/types.go:724-736).
type TaggedEntry ¶ added in v1.3.1
TaggedEntry pairs a resource ARN with its tags.