nats

package
v2.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NATSListenAndServeLoopTimer = 1 * time.Second

Functions

This section is empty.

Types

type NATSServer

type NATSServer struct {
	// contains filtered or unexported fields
}

func NewNATSServer

func NewNATSServer(ctx context.Context, logger nserver.Logger, opts ...NatsOption) (*NATSServer, error)

func (*NATSServer) ListenAndServe

func (n *NATSServer) ListenAndServe() (err error)

ListenAndServe runs the NATSServer in a blocking way until the server is shutdown or an error occurs

func (*NATSServer) Shutdown

func (n *NATSServer) Shutdown()

type NatsOption

type NatsOption func(*nserver.Options)

NatsOption configures the nats server

func AllowNonTLS

func AllowNonTLS(v bool) NatsOption

AllowNonTLS sets the allow non tls options for the nats server

func ClusterID

func ClusterID(clusterID string) NatsOption

ClusterID sets the name for the nats cluster

func Host

func Host(url string) NatsOption

Host sets the host URL for the nats server

func Port

func Port(port int) NatsOption

Port sets the host URL for the nats server

func StoreDir

func StoreDir(StoreDir string) NatsOption

StoreDir sets the folder for persistence

func TLSConfig

func TLSConfig(c *tls.Config) NatsOption

TLSConfig sets the tls config for the nats server

Jump to

Keyboard shortcuts

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