nats_broker

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: LGPL-2.1 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Install   = plugin.Install
	Uninstall = plugin.Uninstall
)

Functions

This section is empty.

Types

type BrokerOptions

type BrokerOptions struct {
	NatsClient    *nats.Conn
	TopicPrefix   string
	QueuePrefix   string
	FastAddresses []string
	FastUsername  string
	FastPassword  string
}

BrokerOptions is a struct that holds various configuration options for the NATS broker.

type Option

type Option struct{}

Option is a struct used for setting options.

func (Option) Default

func (Option) Default() option.Setting[BrokerOptions]

Default sets default values for BrokerOptions.

func (Option) FastAddresses

func (Option) FastAddresses(addrs ...string) option.Setting[BrokerOptions]

FastAddresses sets the addresses in BrokerOptions. If NatsClient is nil, these addresses are used as the connection addresses.

func (Option) FastAuth

func (Option) FastAuth(username, password string) option.Setting[BrokerOptions]

FastAuth sets the authentication credentials in BrokerOptions. If NatsClient is nil, these credentials are used for authentication.

func (Option) NatsClient

func (Option) NatsClient(cli *nats.Conn) option.Setting[BrokerOptions]

NatsClient sets the NATS client in BrokerOptions.

func (Option) QueuePrefix

func (Option) QueuePrefix(prefix string) option.Setting[BrokerOptions]

QueuePrefix sets the queue prefix in BrokerOptions.

func (Option) TopicPrefix

func (Option) TopicPrefix(prefix string) option.Setting[BrokerOptions]

TopicPrefix sets the topic prefix in BrokerOptions.

Jump to

Keyboard shortcuts

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