common

package
v0.0.0-...-bbb8ac2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NatsDeadLetterQueue is the default NATS queue for messages that cannot be delivered
	NatsDeadLetterQueue = "dlq"
)

Variables

This section is empty.

Functions

func HandleSetup

func HandleSetup()

HandleSetup takes care of initializing the logger and a few other components. It's done in the common package so that all agents making use of this function can do the exact same thing.

func NatsConnect

func NatsConnect() (*nats.Conn, error)

NatsConnect handles connecting the a NATS server. It returns a NATS connection based on the environment variables: - NATSNAME: The name of the NATS connection - NATSURL: The URL of the NATS server to connect to

func NatsStop

func NatsStop(nc *nats.Conn)

NatsStop handles gracefully shutting down any connections to the NATS server

Types

type Config

type Config struct {
	LogLevel string `required:"true"`
}

Config contains the common configuration data for the server.

Jump to

Keyboard shortcuts

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