config

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllSettings

func AllSettings() map[string]interface{}

AllSettings 所有配置

func Get

func Get(key string) interface{}

Get 获取所有类型的配置

func GetBool

func GetBool(key string) bool

GetBool 获取布尔类型的配置

func GetInt

func GetInt(key string) int

GetInt 获取整数类型的配置

func GetString

func GetString(key string) string

GetString 获取字符串类型的配置

func GetStringSlice

func GetStringSlice(key string) []string

GetStringSlice 获取字符串数组类型的配置

func Init

func Init(args ...string)

Init 初始化配置文件(参数顺序:name,path,type),默认配置文件为config.yaml

func Unmarshal

func Unmarshal(config interface{}) error

Unmarshal 解析整个配置到指定的结构中

func UnmarshalKey

func UnmarshalKey(key string, config interface{}) error

UnmarshalKey 根据key解析配置到指定的结构中

Types

This section is empty.

Jump to

Keyboard shortcuts

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