nats

package
v0.0.0-...-165bc0d Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EXIT_CODE_DISCONNECT = 1000

Functions

func New

func New(ctx context.Context, cfg *configs.Configs) (msgbus.MsgBus, error)

func NewEvent

func NewEvent(msg *nats.Msg) (*entities.Event, error)

func NewMsg

func NewMsg(cfg *configs.Configs, event *entities.Event) (*nats.Msg, error)

func NewSubject

func NewSubject(cfg *configs.Configs, sample *entities.Event) string

func UseSub

func UseSub(logger *zap.SugaredLogger, fn msgbus.SubscribeFn, backoff []time.Duration) nats.MsgHandler

Types

type Nats

type Nats struct {
	Configs *configs.Configs
	Logger  *zap.SugaredLogger
	// contains filtered or unexported fields
}

func (*Nats) Connect

func (msgbus *Nats) Connect() error

func (*Nats) Disconnect

func (msgbus *Nats) Disconnect() error

func (*Nats) Pub

func (msgbus *Nats) Pub(event *entities.Event) (*string, error)

func (*Nats) Sub

func (msgbus *Nats) Sub(sample *entities.Event, queue string, fn msgbus.SubscribeFn) error

Jump to

Keyboard shortcuts

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