bus

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *Config) *memoryBus

func NewLogSink

func NewLogSink(ch chan Event)

func SetFlags added in v0.2.0

func SetFlags(fs *pflag.FlagSet, cfg *Config)

Types

type Bus

type Bus interface {
	AddListener() chan Event
	Publish(Event)
	Run(context.Context)
	History() []HistoricalEvent
	Errors() []HistoricalError
}

type Config added in v0.2.0

type Config struct {
	MaxEvents            int
	MaxErrors            int
	InboundSize          int
	MinimumPriorityLevel int
	EnableDebugLog       bool
	EnableErrorLog       bool
}

type Event

type Event interface{}

type HistoricalError

type HistoricalError struct {
	E  error
	Ts time.Time
}

func (HistoricalError) FmtTime

func (he HistoricalError) FmtTime() string

func (HistoricalError) Type

func (he HistoricalError) Type() string

type HistoricalEvent

type HistoricalEvent struct {
	E  Event
	Ts time.Time
}

func (HistoricalEvent) FmtTime

func (he HistoricalEvent) FmtTime() string

func (HistoricalEvent) Type

func (he HistoricalEvent) Type() string

Jump to

Keyboard shortcuts

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