configurer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfig

type BuildConfig struct {
	Build                 string
	Component             string
	Version               string
	EMFVersion            string
	EchoVersion           string
	ReleaseTimestamp      string
	AdditionalInformation []DataPoint
}

BuildConfig provides the logger and the info endpoint access to hard-coded build configuration

type Config

type Config interface {
	GetInt(string) int
	GetBool(string) bool
	GetInt64(string) int64
	GetString(string) string

	GetStringMapString(string) map[string]string

	SetConfigName(string)
	SetConfigType(string)
	SetEnvPrefix(string)
	SetEnvKeyReplacer(*strings.Replacer)

	AutomaticEnv()
	ReadInConfig() error
	AddConfigPath(string)
	UnmarshalKey(string, interface{}, ...viper.DecoderConfigOption) error
}

Config provides a method set for extracting data out of a configuration file.

func LoadConfig

func LoadConfig(configFile string, prefix string) Config

LoadConfig loads a configuration file specified by the function argument or a path provided the command line.

type ConfigReader

type ConfigReader interface {
	GetInt(string) int
	GetBool(string) bool
	GetInt64(string) int64
	GetString(string) string
	UnmarshalKey(string, interface{}, ...viper.DecoderConfigOption) error
}

ConfigReader defines the interface for read-only config file access

type DataPoint

type DataPoint struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

DataPoint represents additional information component wants to display

type DomainsReader

type DomainsReader interface {
	GetStringMapString(string) map[string]string
}

DomainsReader defines the interface for read-only map[string]string access

Jump to

Keyboard shortcuts

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