Documentation
¶
Index ¶
- func EncodeEvent(topic string) (payload []byte, key []byte, err error)
- func WithBackend(backend string) func(*EventWorker)
- func WithBacklogSize(size int) func(*EventWorker)
- func WithInterval(interval time.Duration) func(*EventWorker)
- func WithOrigin(origin ytl.Origin) func(*EventWorker)
- func WithTopic(topic string) func(*EventWorker)
- type EventWorker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeEvent ¶
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
Click to show internal directories.
Click to hide internal directories.