nats

package
v0.10.14 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Conn

func Conn() *nats.Conn

func Init

func Init() (err error)

Init initializes the global NATS client. It reads NATS configuration from config.App.NatsConfig. If NATS is not enabled, it returns nil. The function is thread-safe and ensures the client is initialized only once.

func New

func New(cfg config.Nats) (*nats.Conn, error)

New returns a new NATS client instance with given configuration. It's the caller's responsibility to close the client, caller should always call Close() when it's no longer needed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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