nats

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

README

NATS Streaming

This plugin uses NATS Streaming to send and receive events.

Please not that NATS Streaming is deprecated and will be no longer receive security fixes after June of 2023.

You should instead NATS JetStream and the go-micro natsjs plugin.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStream

func NewStream(opts ...Option) (events.Stream, error)

NewStream returns an initialized nats stream or an error if the connection to the nats server could not be established.

Types

type Option

type Option func(o *Options)

Option is a function which configures options.

func Address

func Address(addr string) Option

Address of the nats cluster.

func ClientID

func ClientID(id string) Option

ClientID sets the client id for the nats connection.

func ClusterID

func ClusterID(id string) Option

ClusterID sets the cluster id for the nats connection.

func Logger added in v1.2.0

func Logger(log logger.Logger) Option

Logger sets the underlyin logger

func TLSConfig

func TLSConfig(t *tls.Config) Option

TLSConfig to use when connecting to the cluster.

type Options

type Options struct {
	ClusterID string
	ClientID  string
	Address   string
	TLSConfig *tls.Config
	Logger    logger.Logger
}

Options which are used to configure the nats stream.

Jump to

Keyboard shortcuts

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