Documentation ¶
Index ¶
- type Base
- type Condition
- type ConditionType
- type Event
- type EventType
- type HealthStatus
- type Measure
- type MediaServerMetricsEvent
- type Metric
- type MetricName
- type MetricsMap
- type MultistreamMetrics
- type MultistreamStatus
- type MultistreamTargetInfo
- type MultistreamTargetMetrics
- type MultistreamWebhookPayload
- type OrchestratorMetadata
- type SegmentMetadata
- type StreamMetrics
- type StreamState
- type StreamStateEvent
- type TranscodeAttemptInfo
- type TranscodeEvent
- type UnixMillisTime
- 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"` }
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 EventTypeTranscode EventType = "transcode"
const EventTypeWebhook EventType = "webhook_event"
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 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 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 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 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 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)
Click to show internal directories.
Click to hide internal directories.