viper

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 4 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) AfterInject added in v0.0.33

func (c *Config) AfterInject()

func (*Config) BeforeInject added in v0.0.33

func (c *Config) BeforeInject()

func (*Config) Build

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

func (*Config) Init

func (c *Config) Init()

type RemoteProvider

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

type Viper

type Viper struct {
	*viper.Viper
	Conf Config
}

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

func (*Viper) Close

func (v *Viper) Close() error

func (*Viper) Config

func (v *Viper) Config() any

func (*Viper) Init

func (v *Viper) Init() error

Jump to

Keyboard shortcuts

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