config

package
v0.0.0-...-ed2a021 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: AGPL-3.0 Imports: 8 Imported by: 32

Documentation

Overview

Package config provides helper structs for common components configuration.

All structs in this package implements goconfig.Configurable interface.

This package is a work in progress and makes no API stability promises.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServicesCfg

type APIServicesCfg struct {
	ConfigDirs  []string
	ConfigFiles []string
	CertsDir    string
}

APIServicesCfg stores api services configuration.

func (*APIServicesCfg) BindViper

func (cfg *APIServicesCfg) BindViper(v *viper.Viper, prefix string)

BindViper setups posix flags for commandline configuration and bind to viper.

func (APIServicesCfg) Dump

func (cfg APIServicesCfg) Dump() string

Dump configuration.

func (APIServicesCfg) Empty

func (cfg APIServicesCfg) Empty() bool

Empty returns true if configuration is empty.

func (*APIServicesCfg) FromViper

func (cfg *APIServicesCfg) FromViper(v *viper.Viper, prefix string)

FromViper fill values from viper.

func (*APIServicesCfg) SetPFlags

func (cfg *APIServicesCfg) SetPFlags(short bool, prefix string)

SetPFlags setups posix flags for commandline configuration.

func (APIServicesCfg) Validate

func (cfg APIServicesCfg) Validate() error

Validate checks that configuration is ok.

type ClientCfg

type ClientCfg struct {
	RemoteURI string
	TLS       grpctls.ClientCfg
	Metrics   bool
}

ClientCfg stores grpc client preferences.

func (*ClientCfg) BindViper

func (cfg *ClientCfg) BindViper(v *viper.Viper, prefix string)

BindViper and bind to viper.

func (ClientCfg) Dump

func (cfg ClientCfg) Dump() string

Dump configuration.

func (ClientCfg) Empty

func (cfg ClientCfg) Empty() bool

Empty returns true if configuration is empty.

func (*ClientCfg) FromViper

func (cfg *ClientCfg) FromViper(v *viper.Viper, prefix string)

FromViper fill values from viper.

func (*ClientCfg) SetPFlags

func (cfg *ClientCfg) SetPFlags(short bool, prefix string)

SetPFlags setups posix flags for commandline configuration.

func (ClientCfg) Validate

func (cfg ClientCfg) Validate() error

Validate checks that configuration is ok.

type EventNotifyCfg

type EventNotifyCfg struct {
	Service  string
	Instance string
	Buffer   int
	WaitDups int
}

EventNotifyCfg stores event-notify client configuration.

func (*EventNotifyCfg) BindViper

func (cfg *EventNotifyCfg) BindViper(v *viper.Viper, prefix string)

BindViper setups posix flags for commandline configuration and bind to viper.

func (EventNotifyCfg) Dump

func (cfg EventNotifyCfg) Dump() string

Dump configuration.

func (EventNotifyCfg) Empty

func (cfg EventNotifyCfg) Empty() bool

Empty returns true if configuration is empty.

func (*EventNotifyCfg) FromViper

func (cfg *EventNotifyCfg) FromViper(v *viper.Viper, prefix string)

FromViper fill values from viper.

func (*EventNotifyCfg) SetPFlags

func (cfg *EventNotifyCfg) SetPFlags(short bool, prefix string)

SetPFlags setups posix flags for commandline configuration.

func (EventNotifyCfg) Validate

func (cfg EventNotifyCfg) Validate() error

Validate checks that configuration is ok.

type HealthCfg

type HealthCfg struct {
	ListenURI string
	Allowed   []string
	Metrics   bool
	Profile   bool
}

HealthCfg stores http health server preferences.

func (*HealthCfg) BindViper

func (cfg *HealthCfg) BindViper(v *viper.Viper, prefix string)

BindViper setups posix flags for commandline configuration and bind to viper.

func (HealthCfg) Dump

func (cfg HealthCfg) Dump() string

Dump configuration.

func (HealthCfg) Empty

func (cfg HealthCfg) Empty() bool

Empty returns true if configuration is empty.

func (*HealthCfg) FromViper

func (cfg *HealthCfg) FromViper(v *viper.Viper, prefix string)

FromViper fill values from viper.

func (*HealthCfg) SetPFlags

func (cfg *HealthCfg) SetPFlags(short bool, prefix string)

SetPFlags setups posix flags for commandline configuration.

func (HealthCfg) Validate

func (cfg HealthCfg) Validate() error

Validate checks that configuration is ok.

type LoggerCfg

type LoggerCfg struct {
	Level  string
	Format string
}

LoggerCfg stores logger configuration preferences.

func (*LoggerCfg) BindViper

func (cfg *LoggerCfg) BindViper(v *viper.Viper, prefix string)

BindViper setups posix flags for commandline configuration and bind to viper.

func (LoggerCfg) Dump

func (cfg LoggerCfg) Dump() string

Dump configuration.

func (LoggerCfg) Empty

func (cfg LoggerCfg) Empty() bool

Empty returns true if configuration is empty

func (*LoggerCfg) FromViper

func (cfg *LoggerCfg) FromViper(v *viper.Viper, prefix string)

FromViper fill values from viper.

func (*LoggerCfg) SetPFlags

func (cfg *LoggerCfg) SetPFlags(short bool, prefix string)

SetPFlags setups posix flags for commandline configuration.

func (LoggerCfg) Validate

func (cfg LoggerCfg) Validate() error

Validate checks that configuration is ok.

type ServerCfg

type ServerCfg struct {
	ListenURI string
	Allowed   []string
	TLS       grpctls.ServerCfg
	Metrics   bool
}

ServerCfg stores server preferences.

func (*ServerCfg) BindViper

func (cfg *ServerCfg) BindViper(v *viper.Viper, prefix string)

BindViper setups posix flags for commandline configuration and bind to viper.

func (ServerCfg) Dump

func (cfg ServerCfg) Dump() string

Dump configuration.

func (ServerCfg) Empty

func (cfg ServerCfg) Empty() bool

Empty returns true if configuration is empty.

func (*ServerCfg) FromViper

func (cfg *ServerCfg) FromViper(v *viper.Viper, prefix string)

FromViper fill values from viper.

func (*ServerCfg) SetPFlags

func (cfg *ServerCfg) SetPFlags(short bool, prefix string)

SetPFlags setups posix flags for commandline configuration.

func (*ServerCfg) Validate

func (cfg *ServerCfg) Validate() error

Validate checks that configuration is ok.

Jump to

Keyboard shortcuts

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