config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is the configuration manager.

func New

func New(name, prefix string) *Manager

New returns a new initialized manager with the given config.

func (*Manager) AllSettings

func (mgr *Manager) AllSettings() map[string]interface{}

AllSettings wraps viper.AllSettings()

func (*Manager) ConfigCommand

func (mgr *Manager) ConfigCommand(root *cobra.Command) *cobra.Command

ConfigCommand prints the read config values to the output stream.

func (*Manager) Flags

func (mgr *Manager) Flags() *pflag.FlagSet

Flags returns pflag.FlagSet.

func (*Manager) InitFlags

func (mgr *Manager) InitFlags(cfg interface{}) error

InitFlags initializes the flagset with the provided config.

func (*Manager) ReadInConfig

func (mgr *Manager) ReadInConfig() error

ReadInConfig wraps viper.ReadInConfig()

func (*Manager) Unmarshal

func (mgr *Manager) Unmarshal(config interface{}) error

Unmarshal unmarshals the read config into the provided struct.

func (*Manager) VersionCommand

func (mgr *Manager) VersionCommand(root *cobra.Command) *cobra.Command

VersionCommand prints version information to the output stream.

func (*Manager) Viper

func (mgr *Manager) Viper() *viper.Viper

Viper returns viper.

Jump to

Keyboard shortcuts

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