data

package
v0.2.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 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_  UnixMillisTime `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
}

TODO: Call these just Message for consistency with livepeer-com

func ParseEvent

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

type EventType

type EventType string
const EventTypeTranscode EventType = "transcode"
const EventTypeWebhook EventType = "webhook_event"

type MultistreamTargetInfo added in v0.2.0

type MultistreamTargetInfo struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Profile string `json:"profile"`
}

type MultistreamWebhookPayload added in v0.2.0

type MultistreamWebhookPayload struct {
	Target MultistreamTargetInfo `json:"target"`
}

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 UnixMillisTime         `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 UnixMillisTime added in v0.2.0

type UnixMillisTime struct{ time.Time }

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"`
	StreamID  string          `json:"streamId"`
	SessionID string          `json:"sessionId,omitempty"`
	Payload   json.RawMessage `json:"payload,omitempty"`
}

func NewWebhookEvent added in v0.2.0

func NewWebhookEvent(mid, event, userID, streamID, sessionID string, payload interface{}) (*WebhookEvent, error)

Jump to

Keyboard shortcuts

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