Documentation
¶
Index ¶
- Variables
- func Load(ctx context.Context, name string, to any, opts ...Option) error
- type LoadHolder
- type Loader
- type Option
- func WithHook(hooks ...loader.HookFunc) Option
- func WithHookSet(hooks ...loader.HookFunc) Option
- func WithLoaders(loaders ...LoadHolder) Option
- func WithLogger(logger logadapter.Adapter) Option
- func WithTag(tag string) Option
- func WithWeaklyDashUnderscore(v bool) Option
- func WithWeaklyIgnoreSeperator(v bool) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultLoaders = []LoadHolder{ {Name: "default", Loader: defaultloader.New()}, {Name: "file", Loader: fileloader.New()}, {Name: "env", Loader: envloader.New()}, } DefaultHooks = []loader.HookFunc{ loader.HookTimeDuration, } DefaultOptions = []Option{} )
Functions ¶
Types ¶
type LoadHolder ¶
type Option ¶
type Option func(*option)
func WithHookSet ¶
WithHookSet sets the hooks for conversion.
func WithLoaders ¶
func WithLoaders(loaders ...LoadHolder) Option
WithLoaders sets the loaders to use when loading the configuration.
- order matters
func WithLogger ¶
func WithLogger(logger logadapter.Adapter) Option
WithLogger sets the logger for logging.
func WithWeaklyDashUnderscore ¶
WithWeaklyDashUnderscore sets the weakly dash underscore option.
- default is false
func WithWeaklyIgnoreSeperator ¶
WithWeaklyIgnoreSeperator sets the weakly ignore separator option.
- default is true
Click to show internal directories.
Click to hide internal directories.