conf

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 10

README

conf

conf

Documentation

Index

Constants

View Source
const CONFIG_NAME = "app.yaml"

Variables

View Source
var HOME = filepath.Join(UserHomeDir(), ".shoppe")
View Source
var Instance *viper.Viper

Functions

func AbsPathify

func AbsPathify(inPath string) string

持把 $HOME 转换为真实的路径

func Exists

func Exists(path string) bool

判断所给路径文件/文件夹是否存在

func Get

func Get(key string) interface{}

func GetBool

func GetBool(key string) bool

根据 key 获取 bool

func GetInt

func GetInt(key string) int64

根据 key 获取 int64

func GetMap

func GetMap(key string) map[string]interface{}

根据 key 获取map

func GetString

func GetString(key string) string

根据 key 获取配置

func GetStrings

func GetStrings(key string) []string

根据 key 获取数组

func Init

func Init(appName string)

初始化应用配置

func IsDir

func IsDir(path string) bool

判断所给路径是否为文件夹

func IsFile

func IsFile(path string) bool

判断所给路径是否为文件

func UserHomeDir

func UserHomeDir() string

用户根目录

func WatchConfig

func WatchConfig()

Types

This section is empty.

Jump to

Keyboard shortcuts

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