nats

package
v0.0.0-...-880306c Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImplementsINatsBus

func ImplementsINatsBus(b INatsBus) bool

Types

type INatsBus

type INatsBus interface {
	Close()
	Publish(topic string, data []byte)
	Listen(topic string, facts chan []byte)
	Respond(topic string, hopes chan *nats.Msg)
	Request(topic string, data []byte, timeout time.Duration) []byte
}

func SingletonNatsBus

func SingletonNatsBus(cfg config.INatsConfig) INatsBus

func TransientNatsBus

func TransientNatsBus(cfg config.INatsConfig) INatsBus

type NATSListener

type NATSListener struct {
	Handler infra.IFactHandler
	Topic   string
	// contains filtered or unexported fields
}

func NewNatsListener

func NewNatsListener(natsBus INatsBus,
	topic string,
	handler infra.IFactHandler) *NATSListener

func (*NATSListener) Activate

func (l *NATSListener) Activate()

type NatsBus

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

func (*NatsBus) Close

func (b *NatsBus) Close()

func (*NatsBus) Connection

func (b *NatsBus) Connection() *nats.Conn

func (*NatsBus) Listen

func (b *NatsBus) Listen(topic string, facts chan []byte)

func (*NatsBus) Publish

func (b *NatsBus) Publish(topic string, data []byte)

func (*NatsBus) Request

func (b *NatsBus) Request(topic string, data []byte, timeout time.Duration) []byte

func (*NatsBus) Respond

func (b *NatsBus) Respond(topic string, hopes chan *nats.Msg)

type NatsEmitter

type NatsEmitter struct {
	Handler domain.IEventHandler
	Topic   string
	// contains filtered or unexported fields
}

func NewNatsEmitter

func NewNatsEmitter(natsBus INatsBus, topic string,
	handler domain.IEventHandler) *NatsEmitter

func (*NatsEmitter) Activate

func (e *NatsEmitter) Activate()

type NatsResponder

type NatsResponder struct {
	Topic string
	// contains filtered or unexported fields
}

func NewNatsResponder

func NewNatsResponder(natsBus INatsBus, topic string, handler infra.IHopeHandler) *NatsResponder

func (*NatsResponder) Activate

func (r *NatsResponder) Activate()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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