viper

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 5 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 {
	Debug             bool
	Watch             bool
	ConfigName        string
	ConfigFile        string
	ConfigType        string
	ConfigPermissions os.FileMode
	EnvPrefix         string
	RemoteProvider    []RemoteProvider
	AllowEmptyEnv     bool
	IniLoadOptions    ini.LoadOptions
	EnvVars           []string
}

全局变量,只一个实例,只提供config

func (*Config) Build added in v1.2.1

func (c *Config) Build() *viper.Viper

func (*Config) Init added in v1.4.0

func (c *Config) Init()

func (*Config) InitAfterInject

func (c *Config) InitAfterInject()

func (*Config) InitBeforeInject

func (c *Config) InitBeforeInject()

type RemoteProvider

type RemoteProvider struct {
	Provider      string
	Endpoint      string
	Path          string
	SecretKeyring string
}

type Viper added in v1.2.1

type Viper struct {
	*viper.Viper
	Conf Config
}

不建议使用,请使用viper全局变量

func (*Viper) Close added in v1.2.1

func (v *Viper) Close() error

func (*Viper) Config added in v1.2.1

func (v *Viper) Config() any

func (*Viper) Set added in v1.10.0

func (v *Viper) Set()

Jump to

Keyboard shortcuts

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