config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultName      = "config"
	DefaultExtension = "yaml"
	DefaultPath      = "."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

func New

func New(params Params) (Config, error)

func NewMerged

func NewMerged(base Config, configsParams ...Params) (Config, error)

func (Config) GetSettings

func (c Config) GetSettings() map[string]any

func (Config) MergeInConfig

func (c Config) MergeInConfig(other Config) error

func (Config) Unmarshal

func (c Config) Unmarshal(value any, opts ...viper.DecoderConfigOption) error

type Option

type Option func(v *viper.Viper)

func WithDefault

func WithDefault(data map[string]any) Option

func WithEnvKeyReplacer

func WithEnvKeyReplacer(r *strings.Replacer) Option

func WithEnvPrefix

func WithEnvPrefix(prefix string) Option

type Params

type Params struct {
	Name      string
	Extension string
	Paths     []string
	Options   []Option
}

Jump to

Keyboard shortcuts

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