data

package
v0.0.4-beta.6 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

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_  UnixNanoTime `json:"timestamp"`
	ManifestID_ string       `json:"manifestId"`
}

func (*Base) ID

func (b *Base) ID() uuid.UUID

func (*Base) ManifestID

func (b *Base) ManifestID() string

func (*Base) Timestamp

func (b *Base) Timestamp() time.Time

type Event

type Event interface {
	ID() uuid.UUID
	Timestamp() time.Time
	ManifestID() string
}

func ParseEvent

func ParseEvent(data []byte) (Event, error)

type EventType

type EventType string
const EventTypeTranscode EventType = "transcode"

type OrchestratorMetadata

type OrchestratorMetadata struct {
	Address       string `json:"address"`
	TranscoderUri string `json:"transcodeUri"`
}

type SegmentMetadata

type SegmentMetadata struct {
	Name     string  `json:"name"`
	SeqNo    uint64  `json:"seqNo"`
	Duration float64 `json:"duration"`
	ByteSize int     `json:"byteSize"`
}

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 UnixNanoTime           `json:"startTime"`
	LatencyMs int64                  `json:"latencyMs"`
	Success   bool                   `json:"success"`
	Attempts  []TranscodeAttemptInfo `json:"attempts"`
}

func NewTranscodeEvent

func NewTranscodeEvent(nodeID, mid string, seg SegmentMetadata, startTime time.Time, success bool, attempts []TranscodeAttemptInfo) *TranscodeEvent

type UnixNanoTime

type UnixNanoTime struct{ time.Time }

func (UnixNanoTime) MarshalJSON

func (u UnixNanoTime) MarshalJSON() ([]byte, error)

func (*UnixNanoTime) UnmarshalJSON

func (u *UnixNanoTime) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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