boa

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlags added in v0.1.3

func AddFlags(r *pflag.FlagSet, config interface{}) error

AddFlags adds flags to the provided flag set based on the config struct. Default are set according to the values present in the config struct.

func BindEnv added in v0.1.3

func BindEnv(r ConfigRegistry, config interface{}) error

BindEnv binds the environemt variables based on the config struct.

func DefaultDecodeHooks added in v0.1.3

func DefaultDecodeHooks() []mapstructure.DecodeHookFunc

DefaultDecodeHooks returns a list of useful decoding hooks.

func SetDefaults added in v0.1.3

func SetDefaults(r ConfigRegistry, config interface{}) error

SetDefaults sets the default values based on the values contained in the provided config struct.

func StringToTCPAddrHookFunc added in v0.1.3

func StringToTCPAddrHookFunc() mapstructure.DecodeHookFunc

StringToTCPAddrHookFunc returns a DecodeHookFunc that converts strings to net.TCPAddr

func StringToUDPAddrHookFunc added in v0.1.3

func StringToUDPAddrHookFunc() mapstructure.DecodeHookFunc

StringToUDPAddrHookFunc returns a DecodeHookFunc that converts strings to net.UDPAddr

Types

type ConfigRegistry added in v0.1.3

type ConfigRegistry interface {
	BindEnv(input ...string) error
	SetDefault(key string, value interface{})
}

ConfigRegistry is an abstraction of viper.Viper.

type Pather

type Pather string

Pather wraps a string to implement the Pather interface.

func (Pather) CommandPath

func (p Pather) CommandPath() string

CommandPath returns the wrapped string

Directories

Path Synopsis
Package mock_boa is a generated GoMock package.
Package mock_boa is a generated GoMock package.

Jump to

Keyboard shortcuts

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