Documentation ¶
Index ¶
- type Base
- type Condition
- type ConditionType
- type ErrorInfo
- type Event
- type EventType
- type ExportDataTaskOutput
- type ExportTaskOutput
- type HealthStatus
- type IPFSExportDataInfo
- type IPFSExportInfo
- type InputVideo
- type Measure
- type MediaServerMetricsEvent
- type Metric
- type MetricName
- type MetricsMap
- type MultistreamMetrics
- type MultistreamStatus
- type MultistreamTargetInfo
- type MultistreamTargetMetrics
- type MultistreamWebhookPayload
- type Nullable
- type OrchestratorMetadata
- type SegmentMetadata
- type StreamMetrics
- type StreamState
- type StreamStateEvent
- type TaskInfo
- type TaskOutput
- type TaskPartialOutput
- type TaskResultEvent
- type TaskResultPartialEvent
- type TaskTriggerEvent
- type TranscodeAttemptInfo
- type TranscodeEvent
- type TranscodeFileTaskOutput
- type TranscodeFileTaskOutputPath
- type TranscodeTaskOutput
- type UnixMillisTime
- type UploadTaskOutput
- type WebhookEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { Type_ EventType `json:"type"` ID_ uuid.UUID `json:"id"` Timestamp_ UnixMillisTime `json:"timestamp"` StreamID_ string `json:"streamId,omitempty"` }
type Condition ¶ added in v0.4.5
type Condition struct { Type ConditionType `json:"type,omitempty"` Status *bool `json:"status"` ExtraData interface{} `json:"extraData,omitempty"` Frequency stats.ByWindow `json:"frequency,omitempty"` LastProbeTime *UnixMillisTime `json:"lastProbeTime"` LastTransitionTime *UnixMillisTime `json:"lastTransitionTime"` }
func NewCondition ¶ added in v0.4.5
type ConditionType ¶ added in v0.4.5
type ConditionType string
type EventType ¶
type EventType string
const EventTypeMediaServerMetrics EventType = "media_server_metrics"
const EventTypeStreamState EventType = "stream_state"
const EventTypeTaskResult EventType = "task_result"
const EventTypeTaskResultPartial EventType = "task_result_partial"
const EventTypeTaskTrigger EventType = "task_trigger"
const EventTypeTranscode EventType = "transcode"
const EventTypeWebhook EventType = "webhook_event"
type ExportDataTaskOutput ¶ added in v0.7.3
type ExportDataTaskOutput struct {
IPFS *IPFSExportDataInfo `json:"ipfs,omitempty"`
}
type ExportTaskOutput ¶ added in v0.4.13
type ExportTaskOutput struct { IPFS *IPFSExportInfo `json:"ipfs,omitempty"` Internal interface{} `json:"internal,omitempty"` }
type HealthStatus ¶ added in v0.4.5
type HealthStatus struct { ID string `json:"id"` Healthy *Condition `json:"healthy"` Conditions []*Condition `json:"conditions"` Metrics MetricsMap `json:"metrics,omitempty"` Multistream []*MultistreamStatus `json:"multistream,omitempty"` }
HealthStatus is a soft-immutable struct. It should never be modified inline or a lot of things could become inconsistent. Create a new instance/copy for any mutation to be performed and beware of the internal slices and pointers.
Use NewMergedStatus below to facilitate the creation of new status objects with mutated fields. Notice that you still need to clone the internal slices if you want to do any mutations to them.
func NewHealthStatus ¶ added in v0.4.5
func NewHealthStatus(id string, conditions []*Condition) *HealthStatus
func NewMergedHealthStatus ¶ added in v0.4.5
func NewMergedHealthStatus(base *HealthStatus, values HealthStatus) *HealthStatus
func (*HealthStatus) Condition ¶ added in v0.4.5
func (s *HealthStatus) Condition(typ ConditionType) *Condition
func (*HealthStatus) ConditionsCopy ¶ added in v0.4.5
func (s *HealthStatus) ConditionsCopy() []*Condition
func (*HealthStatus) MetricsCopy ¶ added in v0.4.5
func (s *HealthStatus) MetricsCopy() MetricsMap
func (*HealthStatus) MultistreamCopy ¶ added in v0.4.5
func (s *HealthStatus) MultistreamCopy() []*MultistreamStatus
type IPFSExportDataInfo ¶ added in v0.7.3
type IPFSExportDataInfo struct {
CID string `json:"cid"`
}
type IPFSExportInfo ¶ added in v0.4.13
type InputVideo ¶ added in v0.6.5
type Measure ¶ added in v0.4.5
func (Measure) MarshalJSON ¶ added in v0.4.5
func (*Measure) UnmarshalJSON ¶ added in v0.4.5
type MediaServerMetricsEvent ¶ added in v0.3.0
type MediaServerMetricsEvent struct { Base NodeID string `json:"nodeId"` Region string `json:"region,omitempty"` Stats *StreamMetrics `json:"stats"` Multistream []*MultistreamTargetMetrics `json:"multistream"` }
func NewMediaServerMetricsEvent ¶ added in v0.3.0
func NewMediaServerMetricsEvent(nodeID, region, streamID string, stats *StreamMetrics, multistream []*MultistreamTargetMetrics) *MediaServerMetricsEvent
type Metric ¶ added in v0.4.5
type Metric struct { Name MetricName `json:"name"` Dimensions map[string]string `json:"dimensions,omitempty"` Last Measure `json:"last"` }
type MetricName ¶ added in v0.4.5
type MetricName string
type MetricsMap ¶ added in v0.4.5
type MetricsMap map[MetricName][]*Metric
func (MetricsMap) Add ¶ added in v0.4.5
func (m MetricsMap) Add(metric *Metric) MetricsMap
func (MetricsMap) GetMetric ¶ added in v0.4.5
func (m MetricsMap) GetMetric(name MetricName, dimensions map[string]string) *Metric
type MultistreamMetrics ¶ added in v0.3.0
type MultistreamStatus ¶ added in v0.4.5
type MultistreamStatus struct { Target MultistreamTargetInfo `json:"target"` Connected *Condition `json:"connected"` }
type MultistreamTargetInfo ¶ added in v0.2.0
type MultistreamTargetMetrics ¶ added in v0.3.0
type MultistreamTargetMetrics struct { Target MultistreamTargetInfo `json:"target"` Metrics *MultistreamMetrics `json:"metrics"` }
type MultistreamWebhookPayload ¶ added in v0.2.0
type MultistreamWebhookPayload struct {
Target MultistreamTargetInfo `json:"target"`
}
type Nullable ¶ added in v0.8.0
type Nullable[T any] **T
Nullable represents a field that can be null, 0, or omitted from the serialized JSON (if omitempty is used). It is basically a double pointer for the optional fields so we can represent all possible "nullish" values:
- the field was not asked for and should be omitted: outer pointer nil - the field was asked but not valid (null): outer pointer non-nil, inner pointer nil - the field value is "zero": outer pointer non-nil, inner pointer to &zero
If the field is not nullish, it's just a double pointer to the value.
func ToNullable ¶ added in v0.8.0
type OrchestratorMetadata ¶
type SegmentMetadata ¶
type StreamMetrics ¶ added in v0.3.0
type StreamMetrics struct {
MediaTimeMs *int64 `json:"mediaTimeMs"`
}
type StreamState ¶ added in v0.4.0
type StreamState struct {
Active bool `json:"active"`
}
type StreamStateEvent ¶ added in v0.4.0
type StreamStateEvent struct { Base NodeID string `json:"nodeId"` Region string `json:"region,omitempty"` UserID string `json:"userId"` State StreamState `json:"state"` }
func NewStreamStateEvent ¶ added in v0.4.0
func NewStreamStateEvent(nodeID, region, userID, streamID string, state StreamState) *StreamStateEvent
type TaskInfo ¶ added in v0.4.13
type TaskInfo struct { ID string `json:"id"` Type string `json:"type"` Snapshot json.RawMessage `json:"snapshot"` Step string `json:"step"` StepInput json.RawMessage `json:"stepInput"` }
type TaskOutput ¶ added in v0.4.13
type TaskOutput struct { Upload *UploadTaskOutput `json:"upload,omitempty"` Import *UploadTaskOutput `json:"import,omitempty"` Export *ExportTaskOutput `json:"export,omitempty"` ExportData *ExportDataTaskOutput `json:"exportData,omitempty"` Transcode *TranscodeTaskOutput `json:"transcode,omitempty"` TranscodeFile *TranscodeFileTaskOutput `json:"transcodeFile,omitempty"` Clip *UploadTaskOutput `json:"clip,omitempty"` }
type TaskPartialOutput ¶ added in v0.7.2
type TaskPartialOutput struct {
Upload *UploadTaskOutput `json:"upload,omitempty"`
}
type TaskResultEvent ¶ added in v0.4.13
type TaskResultEvent struct { Base Task TaskInfo `json:"task"` Error *ErrorInfo `json:"error,omitempty"` Output *TaskOutput `json:"output,omitempty"` }
func NewTaskResultEvent ¶ added in v0.4.13
func NewTaskResultEvent(info TaskInfo, err *ErrorInfo, output *TaskOutput) *TaskResultEvent
type TaskResultPartialEvent ¶ added in v0.7.2
type TaskResultPartialEvent struct { Base Task TaskInfo `json:"task"` Output *TaskPartialOutput `json:"output,omitempty"` }
func NewTaskResultPartialEvent ¶ added in v0.7.2
func NewTaskResultPartialEvent(info TaskInfo, output *TaskPartialOutput) *TaskResultPartialEvent
type TaskTriggerEvent ¶ added in v0.4.13
func NewTaskTriggerEvent ¶ added in v0.4.13
func NewTaskTriggerEvent(info TaskInfo) *TaskTriggerEvent
type TranscodeAttemptInfo ¶
type TranscodeAttemptInfo struct { Orchestrator OrchestratorMetadata `json:"orchestrator"` LatencyMs int64 `json:"latencyMs"` Error *string `json:"error"` }
type TranscodeEvent ¶
type TranscodeEvent struct { Base NodeID string `json:"nodeId"` Segment SegmentMetadata `json:"segment"` StartTime UnixMillisTime `json:"startTime"` LatencyMs int64 `json:"latencyMs"` Success bool `json:"success"` Attempts []TranscodeAttemptInfo `json:"attempts"` }
func NewTranscodeEvent ¶
func NewTranscodeEvent(nodeID, streamID string, seg SegmentMetadata, startTime time.Time, success bool, attempts []TranscodeAttemptInfo) *TranscodeEvent
type TranscodeFileTaskOutput ¶ added in v0.6.3
type TranscodeFileTaskOutput struct { BaseUrl string `json:"baseUrl,omitempty"` Hls *TranscodeFileTaskOutputPath `json:"hls,omitempty"` Mp4 []TranscodeFileTaskOutputPath `json:"mp4,omitempty"` RequestID string `json:"request_id,omitempty"` InputVideo *InputVideo `json:"input_video,omitempty"` }
type TranscodeFileTaskOutputPath ¶ added in v0.6.4
type TranscodeFileTaskOutputPath struct {
Path string `json:"path,omitempty"`
}
type TranscodeTaskOutput ¶ added in v0.4.13
type TranscodeTaskOutput struct {
Asset UploadTaskOutput `json:"asset,omitempty"`
}
type UnixMillisTime ¶ added in v0.2.0
func NewUnixMillisTime ¶ added in v0.2.0
func NewUnixMillisTime(unixMillis int64) UnixMillisTime
func (UnixMillisTime) MarshalJSON ¶ added in v0.2.0
func (u UnixMillisTime) MarshalJSON() ([]byte, error)
func (UnixMillisTime) UnixMillis ¶ added in v0.2.0
func (u UnixMillisTime) UnixMillis() int64
func (*UnixMillisTime) UnmarshalJSON ¶ added in v0.2.0
func (u *UnixMillisTime) UnmarshalJSON(data []byte) error
type UploadTaskOutput ¶ added in v0.4.21
type WebhookEvent ¶ added in v0.2.0
type WebhookEvent struct { Base Event string `json:"event"` UserID string `json:"userId"` SessionID string `json:"sessionId,omitempty"` Payload json.RawMessage `json:"payload,omitempty"` }
func NewWebhookEvent ¶ added in v0.2.0
func NewWebhookEvent(streamID, event, userID, sessionID string, payload interface{}) (*WebhookEvent, error)