services

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaMessage

type KafkaMessage struct {
	Ingest    string                 `json:"ingest"`
	IngestID  string                 `json:"ingestId"`
	Timestamp string                 `json:"timestamp"`
	Payload   string                 `json:"payload"`
	Metadata  map[string]interface{} `json:"metadata"`
}

KafkaMessage defines the message structure

type KafkaOperations

type KafkaOperations interface {
	SendMessage(mKey string, mValue KafkaMessage)
	StartBackgroundSend(*sync.WaitGroup, chan bool)
	PayloadQueue() chan<- *Payload
}

KafkaOperations defines operations for kafka messaging

type KafkaService

type KafkaService struct {
	// contains filtered or unexported fields
}

KafkaService implements kafka message functionality

func NewKafkaService

func NewKafkaService(sp sarama.SyncProducer) *KafkaService

NewKafkaService will instantiate an instance using the producer provided

func (*KafkaService) PayloadQueue

func (k *KafkaService) PayloadQueue() chan<- *Payload

PayloadQueue provides access to load a payload object into the queue for sending

func (*KafkaService) SendMessage

func (k *KafkaService) SendMessage(mKey string, mValue KafkaMessage)

SendMessage can send a message to the

func (*KafkaService) StartBackgroundSend

func (k *KafkaService) StartBackgroundSend(sendWaitGroup *sync.WaitGroup, shutdown chan bool)

StartBackgroundSend will start the background sender

type Payload

type Payload struct {
	ID      string
	FrameNo int
	Data    []byte
}

Payload defines the data contained in

type VideoIngestService

type VideoIngestService struct {
	// contains filtered or unexported fields
}

VideoIngestService is a video ingest service

func NewVideoIngestService

func NewVideoIngestService(ks KafkaOperations) *VideoIngestService

NewVideoIngestService instantiates a new instance

func (*VideoIngestService) IngestVideo

func (vs *VideoIngestService) IngestVideo(rtmpURL string)

IngestVideo will ingest a video

Jump to

Keyboard shortcuts

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