infranats

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionConfig

type ConnectionConfig struct {
	// NATS Address
	Address string `mapstructure:"address"`
}

func (*ConnectionConfig) Validate

func (c *ConnectionConfig) Validate() error

type ConnectionsConfig

type ConnectionsConfig map[string]*ConnectionConfig

func (*ConnectionsConfig) Validate

func (c *ConnectionsConfig) Validate() error

type Container

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

Container is a simple container for holding named NATS connections.

func NewContainer

func NewContainer() *Container

func (*Container) Close

func (cont *Container) Close()

Close drains all connection from a container

func (*Container) Connect

func (cont *Container) Connect(name string, cfg *ConnectionConfig) error

Connect creates a new named NATS connection

func (*Container) Get

func (cont *Container) Get(name string) *nats.Conn

Get gets connection from a container

Jump to

Keyboard shortcuts

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