nats

package
v0.0.0-...-e650048 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotReady = errors.New("server still isn't ready for connections")

Functions

func Conn

func Conn() *nats.EncodedConn

Returns the default internal client.

func Disconnect

func Disconnect()

Drains and closes the connection to the embedded NATS server.

func Ping

func Ping[T any](subject string, reply string, config ...PingConfig) ([]T, error)

func Presence

func Presence(subject string) (int, error)

Returns the number of subscribers on a given subject.

func Start

func Start(config *koanf.Koanf, options ...server.Options) error

Start the embedded NATS server. If options are passed as parameters, they will override the internal options (the common config module is used).

Types

type PingConfig

type PingConfig struct {
	HowMany int
	Timeout time.Duration
	Message interface{}
}

Jump to

Keyboard shortcuts

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