bee

package
v0.0.0-...-111e4ad Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeEvent

func EncodeEvent(topic string) (payload []byte, key []byte, err error)

Creates and encodes an Event for a given topic Returns the encoded `event` and `key`

func WithBackend

func WithBackend(backend string) func(*EventWorker)

func WithBacklogSize

func WithBacklogSize(size int) func(*EventWorker)

func WithInterval

func WithInterval(interval time.Duration) func(*EventWorker)

func WithOrigin

func WithOrigin(origin ytl.Origin) func(*EventWorker)

func WithTopic

func WithTopic(topic string) func(*EventWorker)

Types

type EventWorker

type EventWorker struct {
	Topic, OriginChannelId, OriginVideoId, Backend string
	IntervalSeconds, BacklogSize                   int
	KafkaWriter                                    *kafka.Writer
}

func NewEventWorker

func NewEventWorker(options ...func(*EventWorker)) *EventWorker

Create a new EventWorker with some options `WithTopic` and `WithOrigin` are required

func (*EventWorker) Run

func (eventWorker *EventWorker) Run(wg *sync.WaitGroup)

Starts the control loop implemented as a goroutine

Jump to

Keyboard shortcuts

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