config

package
v0.0.0-...-6442850 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(config *Config) error

Validate validates some specific configs. such as config.DNS, config.Labels, config.DNSSearch, as well as config.MaxConcurrentDownloads, config.MaxConcurrentUploads and config.MaxDownloadAttempts.

Types

type Config

type Config struct {
	// The config file.
	ConfigFile string
	// is log level ("debug"|"info"|"warn"|"error"|"fatal")
	LogLevel string
	// is log enabled or not
	Debug bool
	// host to be attach.
	Host string
	// Cors configure
	CorsHeaders string `json:"api-cors-header,omitempty"`
	// cobra flags.
	Flags *pflag.FlagSet

	TLS       bool
	TLSVerify bool
	CAFile    string
	CertFile  string
	KeyFile   string
	ValuesSet map[string]interface{}
}

func MergeDaemonConfigurations

func MergeDaemonConfigurations(flagsConfig *Config, flags *pflag.FlagSet, configFile string) (*Config, error)

MergeDaemonConfigurations reads a configuration file, loads the file configuration in an isolated structure, and merges the configuration provided from flags on top if there are no conflicts.

func NewDaemonConfig

func NewDaemonConfig() *Config

type NamedOption

type NamedOption interface {
	Name() string
}

NamedOption is an interface that list and map options with names implement.

Jump to

Keyboard shortcuts

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