nats

package
v0.0.0-...-6d21404 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	Any any
}

func (Body) Marshal

func (b Body) Marshal() ([]byte, error)

type Broker

type Broker struct {
	*url.URL
	*nats.Conn
	// contains filtered or unexported fields
}

func New

func New(ur1 *url.URL) (*Broker, error)

func (*Broker) At

func (b *Broker) At(n int) string

func (*Broker) Catch

func (b *Broker) Catch(method string, catcher message.Catcher)

func (*Broker) Finish

func (b *Broker) Finish()

func (*Broker) Handle

func (b *Broker) Handle(method string, handler message.Handler)

func (*Broker) Listen

func (b *Broker) Listen(_ context.Context, topic, host, id string) error

func (*Broker) Message

func (b *Broker) Message(_ context.Context, to, by string, v any, oo ...any) (uuid.UUID, error)

func (*Broker) Request

func (b *Broker) Request(_ context.Context, to, by string, v any, oo ...any) (uuid.UUID, message.Message, error)

func (*Broker) Send

func (b *Broker) Send(_ context.Context, m message.Message, oo ...any) (uuid.UUID, error)

func (*Broker) Shutdown

func (b *Broker) Shutdown()

type Message

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

func (Message) AT

func (m Message) AT() string

func (Message) BY

func (m Message) BY() string

func (Message) ID

func (m Message) ID() uuid.UUID

func (Message) Marshal

func (m Message) Marshal() ([]byte, error)

func (Message) OF

func (m Message) OF() [3]string

func (Message) RE

func (m Message) RE() []string

func (Message) TO

func (m Message) TO() string

func (Message) Unmarshal

func (m Message) Unmarshal(a any) error

Jump to

Keyboard shortcuts

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