cfg

package
v0.0.0-...-04d676d Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	Host string
	Port uint32
}

Addr holds remote server's host and port.

type Config

type Config struct {
	Service    Service
	Publisher  Publisher
	Store      Store
	Token      Token
	TraceAgent TraceAgent
}

Config holds the app config.

func New

func New() (*Config, error)

New initializes configuration structure with environment variables and returns it.

type Publisher

type Publisher struct {
	Addr          Addr
	CfgPatchTopic string
}

Publisher holds publisher's configuration.

type Service

type Service struct {
	AppID              string
	LogLevel           string
	RetryTimeout       time.Duration
	RetryAttempts      uint32
	PortRPC            uint32
	PortREST           uint32
	PortWebSocket      uint32
	TerminationTimeout time.Duration
}

Service holds basic service configuration.

type Store

type Store struct {
	Addr             Addr
	Password         string
	IdleTimeout      time.Duration
	MaxIdlePoolConns uint32
}

Store holds store configuration.

type Token

type Token struct {
	PublicKey  string
	PrivateKey string
}

Token holds keys for token handling.

func (Token) Validate

func (t Token) Validate() error

type TraceAgent

type TraceAgent struct {
	Addr Addr
}

TraceAgent holds trace agent configuration.

func (TraceAgent) Validate

func (t TraceAgent) Validate() error

Jump to

Keyboard shortcuts

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