nats

package
v0.0.0-...-5238b66 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientInterface

type ClientInterface interface {
	Subscribe(subj string, cb MsgHandler) (NatsSubscriptionInterface, error)
	QueueSubscribe(subj, queue string, cb MsgHandler) (NatsSubscriptionInterface, error)
	Publish(subj string, data []byte) error
	LastError() error
	Flush() error
	SubscribeSync(reply string) (NatsSubscriptionInterface, error)

	PublishRequest(subj string, reply string, data []byte) error
}

func Connect

func Connect(natsURL string) (ClientInterface, error)

type Msg

type Msg natspkg.Msg

type MsgHandler

type MsgHandler func(*Msg)

type NatsSubscriptionInterface

type NatsSubscriptionInterface interface {
	AutoUnsubscribe(max int) error
	NextMsg(duration time.Duration) (*Msg, error)
	Unsubscribe() error
}

Jump to

Keyboard shortcuts

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