Documentation
¶
Index ¶
- Variables
- type Channel
- 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) CreatePackagingConfiguration(id, packagingGroupID, description string, tags map[string]string) (*PackagingConfiguration, error)
- func (b *InMemoryBackend) DeleteChannel(id string) (*Channel, error)
- func (b *InMemoryBackend) DeleteOriginEndpoint(id string) (*OriginEndpoint, error)
- func (b *InMemoryBackend) DeletePackagingConfiguration(id string) 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) DescribePackagingConfiguration(id string) (*PackagingConfiguration, error)
- func (b *InMemoryBackend) GetChannelLifecyclePolicy(channelID string) (string, 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) ListPackagingConfigurations(maxResults int, nextToken string) ([]*PackagingConfiguration, string, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) PutChannelLifecyclePolicy(channelID, policy 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) 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 OriginEndpoint
- type PackagingConfig
- type PackagingConfiguration
- type Provider
- type S3Destination
- type StorageBackend
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 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 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) CreatePackagingConfiguration ¶
func (b *InMemoryBackend) CreatePackagingConfiguration( id, packagingGroupID, description string, tags map[string]string, ) (*PackagingConfiguration, error)
CreatePackagingConfiguration creates a new packaging configuration.
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) DeletePackagingConfiguration ¶
func (b *InMemoryBackend) DeletePackagingConfiguration(id string) error
DeletePackagingConfiguration removes a packaging configuration.
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) DescribePackagingConfiguration ¶
func (b *InMemoryBackend) DescribePackagingConfiguration(id string) (*PackagingConfiguration, error)
DescribePackagingConfiguration returns a packaging configuration by ID.
func (*InMemoryBackend) GetChannelLifecyclePolicy ¶
func (b *InMemoryBackend) GetChannelLifecyclePolicy(channelID string) (string, error)
GetChannelLifecyclePolicy retrieves the lifecycle policy for a channel.
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) ListPackagingConfigurations ¶
func (b *InMemoryBackend) ListPackagingConfigurations( maxResults int, nextToken string, ) ([]*PackagingConfiguration, string, error)
ListPackagingConfigurations returns all packaging configurations.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
ListTagsForResource returns all tags for a resource.
func (*InMemoryBackend) PutChannelLifecyclePolicy ¶
func (b *InMemoryBackend) PutChannelLifecyclePolicy(channelID, policy string) error
PutChannelLifecyclePolicy stores a lifecycle policy on a channel.
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) 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 OriginEndpoint ¶
type OriginEndpoint struct {
Authorization map[string]any
CmafPackage map[string]any
DashPackage map[string]any
HlsPackage map[string]any
MssPackage 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 map[string]any
CmafPackage map[string]any
DashPackage map[string]any
HlsPackage map[string]any
MssPackage map[string]any
}
PackagingConfig holds the CDN-authorization credentials and per-protocol packaging blocks (HlsPackage/DashPackage/CmafPackage/MssPackage) accepted by CreateOriginEndpoint/UpdateOriginEndpoint. Each block is stored verbatim as the caller supplied it -- encryption/ad-marker semantics are not interpreted -- so Describe/List echo back exactly what was configured. Previously these fields were silently discarded on create/update, so a Terraform/CDK OriginEndpoint configured with e.g. hlsPackage never round-tripped through gopherstack.
type PackagingConfiguration ¶
type PackagingConfiguration struct {
Tags map[string]string `json:"tags,omitempty"`
ARN string
ID string
PackagingGroupID string
Description string
CreatedAt string
}
PackagingConfiguration represents a MediaPackage VOD packaging configuration.
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 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)
// PackagingConfiguration CRUD
CreatePackagingConfiguration(
id, packagingGroupID, description string,
tags map[string]string,
) (*PackagingConfiguration, error)
DescribePackagingConfiguration(id string) (*PackagingConfiguration, error)
DeletePackagingConfiguration(id string) error
ListPackagingConfigurations(maxResults int, nextToken string) ([]*PackagingConfiguration, string, error)
// Channel lifecycle policy
PutChannelLifecyclePolicy(channelID, policy string) error
GetChannelLifecyclePolicy(channelID 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.