moderator

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	Bytes() ([]byte, error)
}

type EventHandler

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

func NewEventHandler

func NewEventHandler(messageChan chan<- []byte, logger log.Logger) *EventHandler

func (EventHandler) HandleEvent

func (e EventHandler) HandleEvent(event Event)

type Handler

type Handler interface {
	HandleEvent(e Event)
}

type NoOpHandler

type NoOpHandler struct{}

func (NoOpHandler) HandleEvent

func (NoOpHandler) HandleEvent(_ Event)

type Worker

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

func NewWorker

func NewWorker(messageChan <-chan []byte, writer Writer, batchInterval time.Duration, logger log.Logger) *Worker

func (*Worker) Close

func (w *Worker) Close() error

func (*Worker) Flush

func (w *Worker) Flush()

func (*Worker) Run

func (w *Worker) Run(ctx context.Context)

type Writer

type Writer interface {
	Write(messages [][]byte) error
	Close() error
}

Jump to

Keyboard shortcuts

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