configs

package
v0.0.0-...-be3f9aa Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Err error
	// contains filtered or unexported fields
}

func New

func New(options ...Option) Config

func (Config) GetBool

func (c Config) GetBool(key string) bool

func (Config) GetDuration

func (c Config) GetDuration(key string) time.Duration

func (Config) GetFloat64

func (c Config) GetFloat64(key string) float64

func (Config) GetInt

func (c Config) GetInt(key string) int

func (Config) GetInt64

func (c Config) GetInt64(key string) int64

func (Config) GetString

func (c Config) GetString(key string) string

func (Config) Name

func (c Config) Name() string

type FlagSet

type FlagSet interface {
	VisitAll(func(*flag.Flag))
	Name() string
	ErrorHandling() flag.ErrorHandling
}

type Option

type Option func(*Config)

func WithArgs

func WithArgs(args []string) Option

func WithEnvFromMap

func WithEnvFromMap(envMap map[string]string) Option

func WithEnvFunc

func WithEnvFunc(envFunc func(string) string) Option

func WithEnvPrefix

func WithEnvPrefix(prefix string) Option

func WithFlagSet

func WithFlagSet(fs FlagSet) Option

func WithOutput

func WithOutput(output io.Writer) Option

type Value

type Value = interface {
	flag.Value
	IsSet() bool
}

Jump to

Keyboard shortcuts

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