config

package
v2.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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"`
	Output    cmq.Config       `koanf:"output"`
	Input     Input            `koanf:"input"`
	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 Input

type Input struct {
	Type      `koanf:"type"`
	Group     string
	NATS      cmq.Config       `koanf:"nats"`
	Streaming streaming.Config `koanf:"streaming"`
}

Input specifies the source of the data which is pushed into jectstream.

type Stream

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

type Type

type Type string
const (
	// Prefix indicates environment variables prefix.
	Prefix = "sjr_"

	StreamingInput Type = "streaming"
	NATSInput      Type = "nats"
)

Jump to

Keyboard shortcuts

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