config

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Prefix indicates environment variables prefix.
	Prefix = "sjr_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger    logger.Config    `koanf:"logger"`
	Telemetry telemetry.Config `koanf:"telemetry"`
	NATS      cmq.Config       `koanf:"nats"`
	Streaming streaming.Config `koanf:"streaming"`
	Stream    Stream           `koanf:"stream"`
	Channel   string           `koanf:"channel"`
	Topics    []string         `koanf:"topics"`
}

Config holds all configurations.

func Default

func Default() Config

Default return default configuration.

func New

func New() Config

New reads configuration with viper.

type Stream added in v1.2.0

type Stream struct {
	Replicas    int              `koanf:"replicas"`
	MaxAge      time.Duration    `koanf:"maxage"`
	StorageType nats.StorageType `koanf:"storagetype"`
}

Stream holds all the stream configuration, please check it with https://pkg.go.dev/github.com/nats-io/nats.go#StreamConfig

Jump to

Keyboard shortcuts

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