bus

package
v1.7.8 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubscribeBuffer  = 1
	SubscriptionName = "events"
)

Variables

This section is empty.

Functions

func NewNATSConnection

func NewNATSConnection() (*nats.EncodedConn, error)

Types

type Bus

type Bus interface {
	Publish(event testkube.Event) error
	Subscribe(queue string, handler Handler) error
	Unsubscribe(queue string) error
	Close() error
}

type EventBusMock added in v1.5.33

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

func NewEventBusMock added in v1.5.33

func NewEventBusMock() *EventBusMock

func (*EventBusMock) Close added in v1.5.33

func (b *EventBusMock) Close() error

func (*EventBusMock) Publish added in v1.5.33

func (b *EventBusMock) Publish(event testkube.Event) error

func (*EventBusMock) Subscribe added in v1.5.33

func (b *EventBusMock) Subscribe(queue string, handler Handler) error

func (*EventBusMock) Unsubscribe added in v1.5.33

func (b *EventBusMock) Unsubscribe(queue string) error

type Handler

type Handler func(event testkube.Event) error

type NATSBus

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

func NewNATSBus

func NewNATSBus(nc *nats.EncodedConn) *NATSBus

func (*NATSBus) Close

func (n *NATSBus) Close() error

func (*NATSBus) Publish

func (n *NATSBus) Publish(event testkube.Event) error

func (*NATSBus) Subscribe

func (n *NATSBus) Subscribe(queueName string, handler Handler) error

func (*NATSBus) Unsubscribe

func (n *NATSBus) Unsubscribe(queueName string) error

Jump to

Keyboard shortcuts

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