config

package
v0.0.0-...-fa01437 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCliReader

func NewCliReader(rootCmd ...*cobra.Command) (io.ReadCloser, error)

func NewFileReader

func NewFileReader(path string) (io.ReadCloser, error)

Types

type Config

type Config struct {
	Viper *viper.Viper
}

func New

func New(reader io.ReadCloser) (*Config, error)

func (*Config) GetBool

func (c *Config) GetBool(k string, defaults ...bool) bool

func (*Config) GetInt

func (c *Config) GetInt(k string, defaults ...int) int

func (*Config) GetString

func (c *Config) GetString(k string, defaults ...string) string

func (*Config) Sub

func (c *Config) Sub(prefix string) (*Config, error)

func (*Config) Unmarshal

func (c *Config) Unmarshal(prefix string, v interface{}) error

func (*Config) UnmarshalALL

func (c *Config) UnmarshalALL(v interface{}) error

Jump to

Keyboard shortcuts

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