Documentation
¶
Index ¶
- Variables
- type Channel
- type ChannelEndpoint
- type ChannelNameCondition
- type EdgeConfig
- type EdgeDeletion
- type EdgeLocalSize
- type EdgeMediaSource
- type EdgeRecorder
- type EdgeSchedule
- type EdgeState
- type EdgeUploader
- type Handler
- func (h *Handler) BackendFor(region string) StorageBackend
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) EnableRegions()
- 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) RegionBackends() []StorageBackend
- func (h *Handler) RegionHandler(region string) *Handler
- 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 ImageGenerationConfig
- type InMemoryBackend
- func (b *InMemoryBackend) CreateSignalingChannel(accountID, region, name, channelType string, messageTTLSeconds int32, ...) (*Channel, error)
- func (b *InMemoryBackend) CreateStream(...) (*Stream, error)
- func (b *InMemoryBackend) DeleteEdgeConfiguration(name, streamARN string) error
- func (b *InMemoryBackend) DeleteSignalingChannel(channelARN, currentVersion string) error
- func (b *InMemoryBackend) DeleteStream(streamARN, currentVersion string) error
- func (b *InMemoryBackend) DescribeEdgeConfiguration(name, streamARN string) (*EdgeState, error)
- func (b *InMemoryBackend) DescribeImageGenerationConfiguration(name, streamARN string) (*ImageGenerationConfig, error)
- func (b *InMemoryBackend) DescribeMediaStorageConfiguration(name, channelARN string) (*MediaStorage, error)
- func (b *InMemoryBackend) DescribeNotificationConfiguration(name, streamARN string) (*NotificationConfig, error)
- func (b *InMemoryBackend) DescribeSignalingChannel(name, channelARN string) (*Channel, error)
- func (b *InMemoryBackend) DescribeStream(name, streamARN string) (*Stream, error)
- func (b *InMemoryBackend) DescribeStreamStorageConfiguration(name, streamARN string) (*Stream, error)
- func (b *InMemoryBackend) GetDataEndpoint(name, streamARN, apiName, region string) (string, error)
- func (b *InMemoryBackend) GetSignalingChannelEndpoint(channelARN, role, region string, protocols []string) ([]ChannelEndpoint, error)
- func (b *InMemoryBackend) ListEdgeAgentConfigurations(hubDeviceARN, nextToken string, maxResults int) ([]*EdgeState, string, error)
- func (b *InMemoryBackend) ListSignalingChannels(nextToken string, maxResults int, condition *ChannelNameCondition) ([]*Channel, string, error)
- func (b *InMemoryBackend) ListStreams(nextToken string, maxResults int, condition *StreamNameCondition) ([]*Stream, string, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) ListTagsForStream(name, streamARN string) (map[string]string, error)
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartEdgeConfigurationUpdate(name, streamARN string, cfg EdgeConfig) (*EdgeState, error)
- func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
- func (b *InMemoryBackend) TagStream(name, streamARN string, tags map[string]string) error
- func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UntagStream(name, streamARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateDataRetention(name, streamARN, currentVersion, operation string, changeInHours int32) error
- func (b *InMemoryBackend) UpdateImageGenerationConfiguration(name, streamARN string, cfg *ImageGenerationConfig) error
- func (b *InMemoryBackend) UpdateMediaStorageConfiguration(channelARN string, cfg MediaStorage) error
- func (b *InMemoryBackend) UpdateNotificationConfiguration(name, streamARN string, cfg *NotificationConfig) error
- func (b *InMemoryBackend) UpdateSignalingChannel(channelARN, currentVersion string, messageTTLSeconds *int32) error
- func (b *InMemoryBackend) UpdateStream(name, streamARN, currentVersion, deviceName, mediaType string) error
- func (b *InMemoryBackend) UpdateStreamStorageConfiguration(name, streamARN, currentVersion, defaultStorageTier string) error
- type MediaStorage
- type NotificationConfig
- type Provider
- type Snapshottable
- type StorageBackend
- type Stream
- type StreamNameCondition
Constants ¶
This section is empty.
Variables ¶
var ( // ErrStreamNotFound is returned when a stream does not exist. ErrStreamNotFound = awserr.New("stream not found", awserr.ErrNotFound) // ErrStreamAlreadyExists is returned when a stream name is already in use. ErrStreamAlreadyExists = awserr.New("stream already exists", awserr.ErrAlreadyExists) // ErrChannelNotFound is returned when a signaling channel does not exist. ErrChannelNotFound = awserr.New("signaling channel not found", awserr.ErrNotFound) // ErrChannelAlreadyExists is returned when a channel name is already in use. ErrChannelAlreadyExists = awserr.New("signaling channel already exists", awserr.ErrAlreadyExists) // ErrVersionMismatch is returned when CurrentVersion does not match the resource's version. ErrVersionMismatch = awserr.New("version mismatch", awserr.ErrConflict) // ErrValidation is returned when request input fails validation. ErrValidation = awserr.New("invalid argument", awserr.ErrInvalidParameter) // ErrEdgeConfigNotFound is returned when a stream has no edge configuration. ErrEdgeConfigNotFound = awserr.New("stream edge configuration not found", awserr.ErrNotFound) // ErrNoDataRetention is returned when an operation needs a stream with a non-zero data retention. ErrNoDataRetention = awserr.New("stream data retention is zero", awserr.ErrInvalidParameter) )
var ErrNoSnapshot = errors.New("backend does not support restore")
ErrNoSnapshot is returned when a backend does not support snapshot/restore.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
CreationTime time.Time
PendingUntil time.Time
MediaStorage *MediaStorage
Tags map[string]string
Name string
ARN string
Type string
Status string
Version string
MessageTTLSeconds int32
}
Channel is the persisted representation of a signaling channel.
type ChannelEndpoint ¶
ChannelEndpoint is one protocol endpoint of a signaling channel.
type ChannelNameCondition ¶
ChannelNameCondition mirrors types.ChannelNameCondition.
type EdgeConfig ¶
type EdgeConfig struct {
Recorder *EdgeRecorder
Deletion *EdgeDeletion
Uploader *EdgeUploader
HubDeviceARN string
}
EdgeConfig mirrors types.EdgeConfig.
type EdgeDeletion ¶
type EdgeDeletion struct {
DeleteAfterUpload *bool
EdgeRetentionInHours *int32
LocalSize *EdgeLocalSize
}
EdgeDeletion mirrors types.DeletionConfig.
type EdgeLocalSize ¶
EdgeLocalSize mirrors types.LocalSizeConfig.
type EdgeMediaSource ¶
EdgeMediaSource mirrors types.MediaSourceConfig.
type EdgeRecorder ¶
type EdgeRecorder struct {
MediaSource *EdgeMediaSource
Schedule *EdgeSchedule
}
EdgeRecorder mirrors types.RecorderConfig.
type EdgeSchedule ¶
EdgeSchedule mirrors types.ScheduleConfig.
type EdgeState ¶
type EdgeState struct {
CreationTime time.Time
LastUpdatedTime time.Time
StreamARN string
StreamName string
SyncStatus string
Config EdgeConfig
}
EdgeState is a stream's edge agent configuration plus its sync bookkeeping. StreamARN and StreamName are filled in on return, not stored.
type EdgeUploader ¶
type EdgeUploader struct {
Schedule *EdgeSchedule
}
EdgeUploader mirrors types.UploaderConfig.
type Handler ¶
type Handler struct {
Backend StorageBackend
AccountID string
DefaultRegion string
// contains filtered or unexported fields
}
Handler is the HTTP handler for the Kinesis Video Streams control-plane REST API.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new Kinesis Video Streams handler.
func (*Handler) BackendFor ¶
func (h *Handler) BackendFor(region string) StorageBackend
BackendFor returns the backend serving region: the home backend, or the sibling built on first use.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) EnableRegions ¶
func (h *Handler) EnableRegions()
EnableRegions makes h serve every other region through lazily built per-region siblings.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the operation name from the request path.
func (*Handler) ExtractResource ¶
ExtractResource extracts the stream or channel name/ARN from the request body.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler serves each request from the handler of its region.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RegionBackends ¶
func (h *Handler) RegionBackends() []StorageBackend
RegionBackends returns the home backend followed by every sibling built so far.
func (*Handler) RegionHandler ¶
RegionHandler returns the handler serving region: h itself for the home region, else its sibling.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches Kinesis Video Streams REST API requests.
type ImageGenerationConfig ¶
type ImageGenerationConfig struct {
FormatConfig map[string]string
DestinationRegion string
URI string
Format string
ImageSelectorType string
Status string
SamplingInterval int32
HeightPixels int32
WidthPixels int32
}
ImageGenerationConfig mirrors types.ImageGenerationConfiguration.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the in-memory implementation of StorageBackend.
func NewInMemoryBackend ¶
func NewInMemoryBackend() *InMemoryBackend
NewInMemoryBackend creates a new in-memory Kinesis Video Streams backend.
func (*InMemoryBackend) CreateSignalingChannel ¶
func (b *InMemoryBackend) CreateSignalingChannel( accountID, region, name, channelType string, messageTTLSeconds int32, tags map[string]string, ) (*Channel, error)
CreateSignalingChannel creates a channel in CREATING; it settles to ACTIVE after transitionDelay.
func (*InMemoryBackend) CreateStream ¶
func (b *InMemoryBackend) CreateStream( accountID, region, name, deviceName, mediaType, kmsKeyID, defaultStorageTier string, dataRetentionInHours int32, tags map[string]string, ) (*Stream, error)
CreateStream creates a stream in CREATING; it settles to ACTIVE after transitionDelay.
func (*InMemoryBackend) DeleteEdgeConfiguration ¶
func (b *InMemoryBackend) DeleteEdgeConfiguration(name, streamARN string) error
DeleteEdgeConfiguration removes a stream's edge agent configuration.
func (*InMemoryBackend) DeleteSignalingChannel ¶
func (b *InMemoryBackend) DeleteSignalingChannel(channelARN, currentVersion string) error
DeleteSignalingChannel marks a channel DELETING under optimistic-lock (CurrentVersion, when supplied).
func (*InMemoryBackend) DeleteStream ¶
func (b *InMemoryBackend) DeleteStream(streamARN, currentVersion string) error
DeleteStream marks a stream DELETING under optimistic-lock (CurrentVersion, when supplied).
func (*InMemoryBackend) DescribeEdgeConfiguration ¶
func (b *InMemoryBackend) DescribeEdgeConfiguration(name, streamARN string) (*EdgeState, error)
DescribeEdgeConfiguration returns a stream's edge agent configuration.
func (*InMemoryBackend) DescribeImageGenerationConfiguration ¶
func (b *InMemoryBackend) DescribeImageGenerationConfiguration(name, streamARN string) (*ImageGenerationConfig, error)
DescribeImageGenerationConfiguration returns a stream's image generation config.
func (*InMemoryBackend) DescribeMediaStorageConfiguration ¶
func (b *InMemoryBackend) DescribeMediaStorageConfiguration(name, channelARN string) (*MediaStorage, error)
DescribeMediaStorageConfiguration returns a channel's media storage configuration, or nil when unset.
func (*InMemoryBackend) DescribeNotificationConfiguration ¶
func (b *InMemoryBackend) DescribeNotificationConfiguration(name, streamARN string) (*NotificationConfig, error)
DescribeNotificationConfiguration returns a stream's notification config.
func (*InMemoryBackend) DescribeSignalingChannel ¶
func (b *InMemoryBackend) DescribeSignalingChannel(name, channelARN string) (*Channel, error)
DescribeSignalingChannel returns the most current information about a channel.
func (*InMemoryBackend) DescribeStream ¶
func (b *InMemoryBackend) DescribeStream(name, streamARN string) (*Stream, error)
DescribeStream returns the most current information about a stream.
func (*InMemoryBackend) DescribeStreamStorageConfiguration ¶
func (b *InMemoryBackend) DescribeStreamStorageConfiguration(name, streamARN string) (*Stream, error)
DescribeStreamStorageConfiguration returns the stream, whose DefaultStorageTier is its storage configuration (HOT when never set).
func (*InMemoryBackend) GetDataEndpoint ¶
func (b *InMemoryBackend) GetDataEndpoint(name, streamARN, apiName, region string) (string, error)
GetDataEndpoint returns an emulator-hosted, AWS-shaped data-plane endpoint for the stream. The KVS data plane (PutMedia/GetMedia/...) is out of scope for this backend -- see PARITY.md -- so the endpoint is wire-accurate but not backed by a functioning media data plane.
func (*InMemoryBackend) GetSignalingChannelEndpoint ¶
func (b *InMemoryBackend) GetSignalingChannelEndpoint( channelARN, role, region string, protocols []string, ) ([]ChannelEndpoint, error)
GetSignalingChannelEndpoint returns emulator-hosted, AWS-shaped endpoints of a channel for each requested protocol.
func (*InMemoryBackend) ListEdgeAgentConfigurations ¶
func (b *InMemoryBackend) ListEdgeAgentConfigurations( hubDeviceARN, nextToken string, maxResults int, ) ([]*EdgeState, string, error)
ListEdgeAgentConfigurations lists the edge configurations of streams bound to hubDeviceARN.
func (*InMemoryBackend) ListSignalingChannels ¶
func (b *InMemoryBackend) ListSignalingChannels( nextToken string, maxResults int, condition *ChannelNameCondition, ) ([]*Channel, string, error)
ListSignalingChannels returns channels matching condition, paginated by nextToken/maxResults.
func (*InMemoryBackend) ListStreams ¶
func (b *InMemoryBackend) ListStreams( nextToken string, maxResults int, condition *StreamNameCondition, ) ([]*Stream, string, error)
ListStreams returns streams matching condition, paginated by nextToken/maxResults.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
ListTagsForResource returns all tags on a signaling channel.
func (*InMemoryBackend) ListTagsForStream ¶
func (b *InMemoryBackend) ListTagsForStream(name, streamARN string) (map[string]string, error)
ListTagsForStream returns all tags on a stream.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore deserializes backend state from a JSON snapshot.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serializes backend state to JSON.
func (*InMemoryBackend) StartEdgeConfigurationUpdate ¶
func (b *InMemoryBackend) StartEdgeConfigurationUpdate(name, streamARN string, cfg EdgeConfig) (*EdgeState, error)
StartEdgeConfigurationUpdate stores or replaces a stream's edge agent configuration.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
TagResource adds or replaces tags on a signaling channel.
func (*InMemoryBackend) TagStream ¶
func (b *InMemoryBackend) TagStream(name, streamARN string, tags map[string]string) error
TagStream adds or replaces tags on a stream.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
UntagResource removes tags from a signaling channel by key.
func (*InMemoryBackend) UntagStream ¶
func (b *InMemoryBackend) UntagStream(name, streamARN string, tagKeys []string) error
UntagStream removes tags from a stream by key.
func (*InMemoryBackend) UpdateDataRetention ¶
func (b *InMemoryBackend) UpdateDataRetention( name, streamARN, currentVersion, operation string, changeInHours int32, ) error
UpdateDataRetention increases or decreases a stream's data retention period.
func (*InMemoryBackend) UpdateImageGenerationConfiguration ¶
func (b *InMemoryBackend) UpdateImageGenerationConfiguration(name, streamARN string, cfg *ImageGenerationConfig) error
UpdateImageGenerationConfiguration sets or clears a stream's image generation config.
func (*InMemoryBackend) UpdateMediaStorageConfiguration ¶
func (b *InMemoryBackend) UpdateMediaStorageConfiguration(channelARN string, cfg MediaStorage) error
UpdateMediaStorageConfiguration enables or disables storing a channel's media in a stream.
func (*InMemoryBackend) UpdateNotificationConfiguration ¶
func (b *InMemoryBackend) UpdateNotificationConfiguration(name, streamARN string, cfg *NotificationConfig) error
UpdateNotificationConfiguration sets or clears a stream's notification config.
func (*InMemoryBackend) UpdateSignalingChannel ¶
func (b *InMemoryBackend) UpdateSignalingChannel(channelARN, currentVersion string, messageTTLSeconds *int32) error
UpdateSignalingChannel updates a channel's SingleMasterConfiguration under optimistic-lock (CurrentVersion).
func (*InMemoryBackend) UpdateStream ¶
func (b *InMemoryBackend) UpdateStream(name, streamARN, currentVersion, deviceName, mediaType string) error
UpdateStream updates a stream's metadata under optimistic-lock (CurrentVersion).
func (*InMemoryBackend) UpdateStreamStorageConfiguration ¶
func (b *InMemoryBackend) UpdateStreamStorageConfiguration( name, streamARN, currentVersion, defaultStorageTier string, ) error
UpdateStreamStorageConfiguration sets a stream's default storage tier under optimistic lock.
type MediaStorage ¶
MediaStorage is a signaling channel's media storage configuration.
type NotificationConfig ¶
NotificationConfig mirrors types.NotificationConfiguration.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the Kinesis Video Streams service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Kinesis Video Streams service backend and handler.
type Snapshottable ¶
type Snapshottable interface {
Snapshot(ctx context.Context) []byte
Restore(context.Context, []byte) error
}
Snapshottable is an optional interface a StorageBackend may implement to support snapshot/restore for persistence or test isolation.
type StorageBackend ¶
type StorageBackend interface {
CreateStream(accountID, region, name, deviceName, mediaType, kmsKeyID, defaultStorageTier string,
dataRetentionInHours int32, tags map[string]string) (*Stream, error)
DescribeStream(name, streamARN string) (*Stream, error)
ListStreams(nextToken string, maxResults int, condition *StreamNameCondition) ([]*Stream, string, error)
UpdateStream(name, streamARN, currentVersion, deviceName, mediaType string) error
DeleteStream(streamARN, currentVersion string) error
UpdateDataRetention(name, streamARN, currentVersion, operation string, changeInHours int32) error
TagStream(name, streamARN string, tags map[string]string) error
UntagStream(name, streamARN string, tagKeys []string) error
ListTagsForStream(name, streamARN string) (map[string]string, error)
TagResource(resourceARN string, tags map[string]string) error
UntagResource(resourceARN string, tagKeys []string) error
ListTagsForResource(resourceARN string) (map[string]string, error)
GetDataEndpoint(name, streamARN, apiName, region string) (string, error)
DescribeImageGenerationConfiguration(name, streamARN string) (*ImageGenerationConfig, error)
UpdateImageGenerationConfiguration(name, streamARN string, cfg *ImageGenerationConfig) error
DescribeNotificationConfiguration(name, streamARN string) (*NotificationConfig, error)
UpdateNotificationConfiguration(name, streamARN string, cfg *NotificationConfig) error
CreateSignalingChannel(
accountID, region, name, channelType string, messageTTLSeconds int32, tags map[string]string,
) (*Channel, error)
DescribeSignalingChannel(name, channelARN string) (*Channel, error)
ListSignalingChannels(nextToken string, maxResults int, condition *ChannelNameCondition) ([]*Channel, string, error)
UpdateSignalingChannel(channelARN, currentVersion string, messageTTLSeconds *int32) error
DeleteSignalingChannel(channelARN, currentVersion string) error
DescribeStreamStorageConfiguration(name, streamARN string) (*Stream, error)
UpdateStreamStorageConfiguration(name, streamARN, currentVersion, defaultStorageTier string) error
DescribeMediaStorageConfiguration(name, channelARN string) (*MediaStorage, error)
UpdateMediaStorageConfiguration(channelARN string, cfg MediaStorage) error
GetSignalingChannelEndpoint(channelARN, role, region string, protocols []string) ([]ChannelEndpoint, error)
StartEdgeConfigurationUpdate(name, streamARN string, cfg EdgeConfig) (*EdgeState, error)
DescribeEdgeConfiguration(name, streamARN string) (*EdgeState, error)
DeleteEdgeConfiguration(name, streamARN string) error
ListEdgeAgentConfigurations(hubDeviceARN, nextToken string, maxResults int) ([]*EdgeState, string, error)
Reset()
}
StorageBackend is the interface for the Kinesis Video Streams backend.
type Stream ¶
type Stream struct {
CreationTime time.Time
PendingUntil time.Time
ImageGeneration *ImageGenerationConfig
Notification *NotificationConfig
Edge *EdgeState
Tags map[string]string
Name string
ARN string
Status string
Version string
DeviceName string
KmsKeyID string
MediaType string
DefaultStorageTier string
DataRetentionInHours int32
}
Stream is the persisted representation of a Kinesis video stream.
type StreamNameCondition ¶
StreamNameCondition mirrors types.StreamNameCondition.
Source Files
¶
- edge.go
- edge_models.go
- errors.go
- handler.go
- handler_configs.go
- handler_edge.go
- handler_signaling.go
- handler_storage.go
- handler_streams.go
- handler_tags.go
- interfaces.go
- lifecycle.go
- listing.go
- models.go
- persistence.go
- provider.go
- regions.go
- signaling.go
- storage.go
- store.go
- store_setup.go
- streams.go
- tags.go
- wire.go
- wire_edge.go