config

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Viper

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

Viper 配置文件实例

func New

func New(paths ...string) (*Viper, error)

New 读取配置文件

func (*Viper) Get

func (this *Viper) Get(key string) interface{}

Get 获取配置值

func (*Viper) GetBool

func (this *Viper) GetBool(key string) bool

GetBool 获取配置布尔值

func (*Viper) GetFloat64

func (this *Viper) GetFloat64(key string) float64

GetFloat64 获取配置浮点型值

func (*Viper) GetInt

func (this *Viper) GetInt(key string) int

GetInt 获取配置整型值

func (*Viper) GetInt32

func (this *Viper) GetInt32(key string) int32

GetInt32 获取配置32位整型值

func (*Viper) GetInt64

func (this *Viper) GetInt64(key string) int64

GetInt64 获取配置64位整型值

func (*Viper) GetString

func (this *Viper) GetString(key string) string

GetString 获取配置字符串值

func (*Viper) GetStringSlice

func (this *Viper) GetStringSlice(key string) []string

GetStringSlice 获取配置字符串切片值

func (*Viper) SetDefaultValue

func (this *Viper) SetDefaultValue(defaultValue map[string]interface{})

SetDefaultValue 设置默认值

func (*Viper) UnmarshalKey

func (this *Viper) UnmarshalKey(key string, rawVal interface{}) error

UnmarshalKey 获取配置字符串map值

Jump to

Keyboard shortcuts

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