config

package
v0.0.0-...-ee94258 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const AppName = "nixeepass"

Variables

This section is empty.

Functions

func OnConfigChange

func OnConfigChange(e fsnotify.Event)

func RegisterOnConfigChange

func RegisterOnConfigChange(run func(in fsnotify.Event))

Types

type Provider

type Provider interface {
	ConfigFileUsed() string
	Get(key string) interface{}
	GetBool(key string) bool
	GetDuration(key string) time.Duration
	GetFloat64(key string) float64
	GetInt(key string) int
	GetInt64(key string) int64
	GetSizeInBytes(key string) uint
	GetString(key string) string
	GetStringMap(key string) map[string]interface{}
	GetStringMapString(key string) map[string]string
	GetStringMapStringSlice(key string) map[string][]string
	GetStringSlice(key string) []string
	GetTime(key string) time.Time
	InConfig(key string) bool
	IsSet(key string) bool
	Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
	UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
}

Provider defines a set of read-only methods for accessing the application configuration params as defined in one of the config files.

func Config

func Config() Provider

Config returns a default config providers

func LoadConfigProvider

func LoadConfigProvider(appName string) Provider

LoadConfigProvider returns a configured viper instance

Jump to

Keyboard shortcuts

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