Documentation
¶
Index ¶
- Constants
- func ParseRawMessage(rawMsg []byte) (interface{}, error)
- type BaseBroadcast
- type BaseMessage
- type BaseRequest
- type BaseResponse
- type ChangeSourceStreamingStateRequest
- type CloseAllActiveRecordingRequest
- type GeneralResponse
- type GetVideoSourceByNameRequest
- type GetVideoSourceByNameResponse
- type ListActiveRecordingsRequest
- type ListActiveRecordingsResponse
- type RecordingSegmentReport
- type StartVideoRecordingRequest
- type StopVideoRecordingRequest
- type VideoSourceStatusReport
Constants ¶
const ( // HTTPSegmentForwardHeaderSourceID standard HTTP header of source ID parameter used // when forwarding video segments from edge node to system control node HTTPSegmentForwardHeaderSourceID = "Source-ID" // HTTPSegmentForwardHeaderName standard HTTP header of segment name parameter used // when forwarding video segments from edge node to system control node HTTPSegmentForwardHeaderName = "Segment-Name" // HTTPSegmentForwardHeaderStartTS standard HTTP header of segment start timestamp // parameter used when forwarding video segments from edge node to system control node HTTPSegmentForwardHeaderStartTS = "Segment-Start-TS" // HTTPSegmentForwardHeaderLength standard HTTP header of segment length in msec // parameter used when forwarding video segments from edge node to system control node HTTPSegmentForwardHeaderLength = "Segment-Length-MSec" // HTTPSegmentForwardHeaderSegURI standard HTTP header of segment URI parameter used // when forwarding video segments from edge node to system control node HTTPSegmentForwardHeaderSegURI = "Segment-URI" )
Variables ¶
This section is empty.
Functions ¶
func ParseRawMessage ¶
ParseRawMessage parse raw IPC message
@param rawMsg []byte - original message @returns parsed message
Types ¶
type BaseBroadcast ¶
type BaseBroadcast struct {
BaseMessage
// BroadcastType the broadcast type
BroadcastType baseBroadcastTypeDT `json:"broadcast_type" validate:"required,oneof=report_video_source_status"`
}
BaseBroadcast base broadcast IPC message payload. All other broadcasts must be built upon this structure
type BaseMessage ¶
type BaseMessage struct {
// Type the message type
Type baseMessageTypeDT `json:"type" validate:"required,oneof=request response broadcast"`
}
BaseMessage base request-response IPC message payload. All other messages must be built upon this structure.
type BaseRequest ¶
type BaseRequest struct {
BaseMessage
// RequestType the request type
RequestType baseRequestTypeDT `json:"request_type" validate:"required,oneof=get_video_source change_stream_state"`
}
BaseRequest base request IPC message payload. All other requests must be built upon this structure.
type BaseResponse ¶
type BaseResponse struct {
BaseMessage
ResponseType baseResponseTypeDT `json:"response_type" validate:"required,oneof=general_resp get_video_source_resp"`
}
BaseResponse base response IPC message payload. All other responses must be built upon this structure.
type ChangeSourceStreamingStateRequest ¶
type ChangeSourceStreamingStateRequest struct {
BaseRequest
// SourceID video source ID
SourceID string `json:"source_id" validate:"required"`
// NewState new video source streaming state
NewState int `json:"new_state" validate:"oneof=-1 1"`
}
ChangeSourceStreamingStateRequest RR request change video source streaming type
func NewChangeSourceStreamingStateRequest ¶
func NewChangeSourceStreamingStateRequest( sourceID string, newState int, ) ChangeSourceStreamingStateRequest
NewChangeSourceStreamingStateRequest define new ChangeSourceStreamingStateRequest message
@param sourceID string - video source ID @param newState int - new streaming state @returns defined structure
type CloseAllActiveRecordingRequest ¶
type CloseAllActiveRecordingRequest struct {
BaseRequest
// SourceID video source ID
SourceID string `json:"source_id" validate:"required"`
}
CloseAllActiveRecordingRequest RR request close all active recording sessions
func NewCloseAllActiveRecordingRequest ¶
func NewCloseAllActiveRecordingRequest(sourceID string) CloseAllActiveRecordingRequest
NewCloseAllActiveRecordingRequest define new CloseAllActiveRecordingRequest message
@param sourceID string - video source ID @returns defined structure
type GeneralResponse ¶
type GeneralResponse struct {
BaseResponse
// Success whether the request succeeded
Success bool `json:"success"`
// ErrorMsg if request failed, the error message
ErrorMsg string `json:"error,omitempty"`
}
GeneralResponse RR general purpose response
func NewGeneralResponse ¶
func NewGeneralResponse(success bool, errorMsg string) GeneralResponse
NewGeneralResponse define new GeneralResponse message
@param success bool - whether the request succeeded @param errorMsg string - if request failed, the error message @returns defined structure
type GetVideoSourceByNameRequest ¶
type GetVideoSourceByNameRequest struct {
BaseRequest
// TargetName the video source name to query for
TargetName string `json:"target_name" validate:"required"`
}
GetVideoSourceByNameRequest RR request info for video source by name
func NewGetVideoSourceByNameRequest ¶
func NewGetVideoSourceByNameRequest(sourceName string) GetVideoSourceByNameRequest
NewGetVideoSourceByNameRequest define new GetVideoSourceByNameRequest message
@param sourceName string - video source name @returns defined structure
type GetVideoSourceByNameResponse ¶
type GetVideoSourceByNameResponse struct {
BaseResponse
// Source the video source info
Source common.VideoSource `json:"source" validate:"required,dive"`
}
GetVideoSourceByNameResponse RR response containing video source info
func NewGetVideoSourceByNameResponse ¶
func NewGetVideoSourceByNameResponse(sourceInfo common.VideoSource) GetVideoSourceByNameResponse
NewGetVideoSourceByNameResponse define new GetVideoSourceByNameResponse message
@param sourceInfo common.VideoSource - video source info @returns defined structure
type ListActiveRecordingsRequest ¶
type ListActiveRecordingsRequest struct {
BaseRequest
// SourceID video source ID
SourceID string `json:"source_id" validate:"required"`
}
ListActiveRecordingsRequest RR request list all active recording sessions associated with a video source
func NewListActiveRecordingsRequest ¶
func NewListActiveRecordingsRequest(sourceID string) ListActiveRecordingsRequest
NewListActiveRecordingsRequest define new ListActiveRecordingsRequest message
@param sourceID string - video source ID @returns defined structure
type ListActiveRecordingsResponse ¶
type ListActiveRecordingsResponse struct {
BaseResponse
// Recordings list of active recordings
Recordings []common.Recording `json:"recordings" validate:"required,gte=1,dive"`
}
ListActiveRecordingsResponse RR response containing a list of active recording sessions
func NewListActiveRecordingsResponse ¶
func NewListActiveRecordingsResponse(recordings []common.Recording) ListActiveRecordingsResponse
NewListActiveRecordingsResponse define new ListActiveRecordingsResponse message
@param recordings []common.Recording - list of active recording sessions @returns defined structure
type RecordingSegmentReport ¶
type RecordingSegmentReport struct {
BaseBroadcast
// RecordingIDs set of recording sessions ID which the segments belong to
RecordingIDs []string `json:"recordings" validate:"required,gte=1"`
// Segments set of video segments to report
Segments []common.VideoSegment `json:"segments" validate:"required,gte=1,dive"`
}
RecordingSegmentReport broadcast new video segments associated with recording sessions
func NewRecordingSegmentReport ¶
func NewRecordingSegmentReport( recordingIDs []string, segments []common.VideoSegment, ) RecordingSegmentReport
NewRecordingSegmentReport define new RecordingSegmentReport message
@param recordingIDs []string - set of recording sessions ID which the segments belong to @param segments []common.VideoSegment - set of video segments to report @returns defined structure
type StartVideoRecordingRequest ¶
type StartVideoRecordingRequest struct {
BaseRequest
// Session information regarding the recording session
Session common.Recording `json:"session" validate:"required,dive"`
}
StartVideoRecordingRequest RR request start video recording session
func NewStartVideoRecordingSessionRequest ¶
func NewStartVideoRecordingSessionRequest(session common.Recording) StartVideoRecordingRequest
NewStartVideoRecordingSessionRequest define new StartVideoRecordingSessionRequest message
@param session common.Recording - the video recording session @returns defined structure
type StopVideoRecordingRequest ¶
type StopVideoRecordingRequest struct {
BaseRequest
// RecordingID recording session ID
RecordingID string `json:"session_id" validate:"required"`
// EndTime the end point for the recording session
EndTime time.Time `json:"end_time" validate:"required"`
}
StopVideoRecordingRequest RR request stop video recording session
func NewStopVideoRecordingSessionRequest ¶
func NewStopVideoRecordingSessionRequest( recordingID string, endTime time.Time, ) StopVideoRecordingRequest
NewStopVideoRecordingSessionRequest define new StopVideoRecordingSessionRequest message
@param recordingID string - recording session ID @param endTime time.Time - recording session end point @returns defined structure
type VideoSourceStatusReport ¶
type VideoSourceStatusReport struct {
BaseBroadcast
// SourceID video source ID
SourceID string `json:"source_id" validate:"required"`
// RequestResponseTargetID the request-response target ID for reaching video source
// over request-response network.
RequestResponseTargetID string `json:"rr_target_id" validate:"required"`
// LocalTimestamp video source local time
LocalTimestamp time.Time `json:"local_timestamp"`
}
VideoSourceStatusReport broadcast video source status report
func NewVideoSourceStatusReport ¶
func NewVideoSourceStatusReport( sourceID, reqRespTargetID string, lclTimestamp time.Time, ) VideoSourceStatusReport
NewVideoSourceStatusReport define new VideoSourceStatusReport message
@param sourceID string - video source ID
@param reqRespTargetID string - the request-response target ID for reaching video source
over request-response network.
@param lclTimestamp time.Time - video source local time
@returns defined structure