forwarder

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LiveStreamSegmentForwarder

type LiveStreamSegmentForwarder interface {
	/*
		Stop stop any background support tasks

			@param ctxt context.Context - execution context
	*/
	Stop(ctxt context.Context) error

	/*
		ForwardSegment process a new segment for forwarding

			@param ctxt context.Context - execution context
			@param segment common.VideoSegmentWithData - segment to process
	*/
	ForwardSegment(ctxt context.Context, segment common.VideoSegmentWithData) error
}

LiveStreamSegmentForwarder forward video segments in support of a live streaming a video source

func NewHTTPLiveStreamSegmentForwarder

func NewHTTPLiveStreamSegmentForwarder(
	parentCtxt context.Context,
	dbConns db.ConnectionManager,
	sender SegmentSender,
	maxInFlightSegments int,
) (LiveStreamSegmentForwarder, error)

NewHTTPLiveStreamSegmentForwarder define new HTTP version of LiveStreamSegmentForwarder

@param parentCtxt context.Context - forwarder's parent execution context
@param dbConns db.ConnectionManager - DB connection manager
@param sender SegmentSender - client for forwarding video segments to system control node
@param maxInFlightSegments int - max number of segment being forwarded at any one time
@returns new LiveStreamSegmentForwarder

type RecordingSegmentForwarder

type RecordingSegmentForwarder interface {
	/*
		Stop stop any background support tasks

			@param ctxt context.Context - execution context
	*/
	Stop(ctxt context.Context) error

	/*
		ForwardSegment process new segments associated with active video recording sessions

			@param ctxt context.Context - execution context
			@param recordings []string - set of recording session IDs
			@param segments []common.VideoSegmentWithData - new video segments to report
	*/
	ForwardSegment(
		ctxt context.Context, recordings []string, segments []common.VideoSegmentWithData,
	) error
}

RecordingSegmentForwarder forward video segments associated with active recording sessions

func NewS3RecordingSegmentForwarder

func NewS3RecordingSegmentForwarder(
	parentCtxt context.Context,
	storageCfg common.RecordingStorageConfig,
	s3Client SegmentSender,
	broadcastClient utils.Broadcaster,
	maxInFlightSegments int,
) (RecordingSegmentForwarder, error)

NewS3RecordingSegmentForwarder define new S3 version of RecordingSegmentForwarder

@param parentCtxt context.Context - forwarder's parent execution context
@param storageCfg common.RecordingStorageConfig - segment storage config
@param s3Client SegmentSender - S3 segment transport client
@param broadcastClient utils.Broadcaster - message broadcast client
@param maxInFlightSegments int - max number of segment being stored at any one time
@returns new RecordingSegmentForwarder

type SegmentSender

type SegmentSender interface {
	/*
		ForwardSegment forward a video segment to a receiver

			@param ctxt context.Context - execution context
			@param segment common.VideoSegmentWithData - the video segment to forward
	*/
	ForwardSegment(ctxt context.Context, segment common.VideoSegmentWithData) error
}

SegmentSender video segment transmit client

func NewHTTPSegmentSender

func NewHTTPSegmentSender(
	ctxt context.Context,
	segmentReceiverURI *url.URL,
	requestIDHeader string,
	httpClient *resty.Client,
	segmentMetrics utils.SegmentMetricsAgent,
	readLatencyMetrics *prometheus.CounterVec,
) (SegmentSender, error)

NewHTTPSegmentSender define new HTTP video segment transmit client

@param ctxt context.Context - execution context
@param segmentReceiverURI *url.URL - the URL to send the segments to
@param requestIDHeader string - HTTP header to set for the request ID
@param httpClient *resty.Client - HTTP client to use
@param segmentMetrics utils.SegmentMetricsAgent - segment forwarding metrics helper agent
@param readLatencyMetrics *prometheus.CounterVec - segment forward latency metrics
@returns new sender instance

func NewS3SegmentSender

func NewS3SegmentSender(
	ctxt context.Context,
	s3Client utils.S3Client,
	dbConns db.ConnectionManager,
	segmentMetrics utils.SegmentMetricsAgent,
	readLatencyMetrics *prometheus.CounterVec,
) (SegmentSender, error)

NewS3SegmentSender define new S3 video segment transmit client

@param ctxt context.Context - execution context
@param s3Client utils.S3Client - S3 operations client
@param dbConns db.ConnectionManager - DB connection manager
@param segmentMetrics utils.SegmentMetricsAgent - segment forwarding metrics helper agent
@param readLatencyMetrics *prometheus.CounterVec - segment forward latency metrics
@returns new sender instance

Jump to

Keyboard shortcuts

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