kinesisvideo

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 26 Imported by: 0

README

Kinesisvideo

Parity grade: A · SDK aws-sdk-go-v2/service/kinesisvideo@v1.41.1 · last audited 2026-10-05 (5bb0d02ee)

Coverage

Metric Value
PARITY entries audited 32 (31 ok, 1 deferred)
Feature families 5 (5 ok)
Known gaps none
Structural gaps (can't be emulated) 3
Deferred items 0
Resource leaks clean
Structural gaps

These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.

  • Media data plane is not in this module: PutMedia/GetMedia, GetHLSStreamingSessionURL/GetDASHStreamingSessionURL/GetClip/ListFragments, the signaling-channel message plane (kinesisvideosignaling) and WebRTC storage sessions are separate AWS services with their own SDK modules, wire protocols (streaming MKV fragments, HLS/DASH muxing, ICE/TURN) and endpoints. GetDataEndpoint and GetSignalingChannelEndpoint return AWS-shaped hostnames that nothing listens on.
  • EdgeAgentStatus / FailedStatusDetails on DescribeEdgeConfiguration are never populated: they report the state of a physical edge agent. SYNCING flips to IN_SYNC after 2s in its place.
  • DescribeMappedResourceConfiguration is not implemented: it reports the resources mapped to a stream by WebRTC ingestion, but MappedResourceConfigurationListItem.Type is an unconstrained string whose values neither the pinned SDK nor the API reference publish, so any value emitted would be invented.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
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)
)
View Source
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

type ChannelEndpoint struct {
	Protocol string
	Endpoint string
}

ChannelEndpoint is one protocol endpoint of a signaling channel.

type ChannelNameCondition

type ChannelNameCondition struct {
	ComparisonOperator string
	ComparisonValue    string
}

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

type EdgeLocalSize struct {
	StrategyOnFullSize    string
	MaxLocalMediaSizeInMB int32
}

EdgeLocalSize mirrors types.LocalSizeConfig.

type EdgeMediaSource

type EdgeMediaSource struct {
	MediaURISecretARN string
	MediaURIType      string
}

EdgeMediaSource mirrors types.MediaSourceConfig.

type EdgeRecorder

type EdgeRecorder struct {
	MediaSource *EdgeMediaSource
	Schedule    *EdgeSchedule
}

EdgeRecorder mirrors types.RecorderConfig.

type EdgeSchedule

type EdgeSchedule struct {
	ScheduleExpression string
	DurationInSeconds  int32
}

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

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this handler handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

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

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the operation name from the request path.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the stream or channel name/ARN from the request body.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

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

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) RegionBackends

func (h *Handler) RegionBackends() []StorageBackend

RegionBackends returns the home backend followed by every sibling built so far.

func (*Handler) RegionHandler

func (h *Handler) RegionHandler(region string) *Handler

RegionHandler returns the handler serving region: h itself for the home region, else its sibling.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears every region.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches Kinesis Video Streams REST API requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable; other regions ride in an additive "regions" key.

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) Reset

func (b *InMemoryBackend) Reset()

Reset clears all backend state.

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

type MediaStorage struct {
	Status    string
	StreamARN string
}

MediaStorage is a signaling channel's media storage configuration.

type NotificationConfig

type NotificationConfig struct {
	DestinationURI string
	Status         string
}

NotificationConfig mirrors types.NotificationConfiguration.

type Provider

type Provider struct{}

Provider implements service.Provider for the Kinesis Video Streams service.

func (*Provider) Init

Init initializes the Kinesis Video Streams service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

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

type StreamNameCondition struct {
	ComparisonOperator string
	ComparisonValue    string
}

StreamNameCondition mirrors types.StreamNameCondition.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL