bus

package
v1.5.32 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 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 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