events

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	Consume(string, any) (any, error)
}

type ConsumerFunc

type ConsumerFunc = func() (any, error)

type Nats

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

func NatsEvents

func NatsEvents(nc *nats.EncodedConn) *Nats

func (*Nats) Consume

func (n *Nats) Consume(topic string, handler NatsHandler) (*nats.Subscription, error)

func (*Nats) Produce

func (n *Nats) Produce(topic string, msg any) error

func (*Nats) Request

func (n *Nats) Request(topic string, payload any, response *any, timeout time.Duration) error

type NatsHandler

type NatsHandler = func(m *nats.Msg)

type Producer

type Producer interface {
	Produce(ctx context.Context, topic string, message any)
}

Jump to

Keyboard shortcuts

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