event

package
v0.0.0-...-094827e Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Barrier

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

func NewBarrier

func NewBarrier(stream Stream) (*Barrier, func())

func (*Barrier) ID

func (b *Barrier) ID() string

func (*Barrier) Wait

func (b *Barrier) Wait(ctx context.Context) error

type Broker

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

func NewBroker

func NewBroker(syslog *zap.SugaredLogger) *Broker

func (*Broker) Publish

func (b *Broker) Publish(event *Event)

func (*Broker) Subscribe

func (b *Broker) Subscribe(handler Handler, opts ...Opt) func()

type Event

type Event struct {
	Meta    *eventsv1.Meta
	Payload proto.Message
}

func Unmarshal

func Unmarshal(event *eventsv1.Event) (*Event, error)

func (*Event) Marshal

func (e *Event) Marshal() (*eventsv1.Event, error)

type Handler

type Handler func(event *Event)

type Opt

type Opt interface {
	Apply(opts *Opts)
}

func WithPredicate

func WithPredicate(predicate Predicate) Opt

type Opts

type Opts struct {
	Predicates []Predicate
}

type Predicate

type Predicate func(event *Event) bool

type Sequencer

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

func NewSequencer

func NewSequencer(stream Stream) *Sequencer

func (*Sequencer) Publish

func (s *Sequencer) Publish(event *Event)

type Stream

type Stream interface {
	Publish(event *Event)
	Subscribe(handler Handler, opts ...Opt) func()
}

Jump to

Keyboard shortcuts

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