config

package
v0.0.0-...-1272ae6 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBool

func DefaultBool(key string, def bool) bool

DefaultBool DefaultBool

func DefaultFloat

func DefaultFloat(key string, def float64) float64

DefaultInt DefaultInt

func DefaultInt

func DefaultInt(key string, def int) int

DefaultInt DefaultInt

func DefaultInt64

func DefaultInt64(key string, def int64) int64

DefaultInt DefaultInt

func DefaultString

func DefaultString(key, def string) string

DefaultString

func GetBool

func GetBool(key string) (bool, error)

GetInt64

func GetFloat

func GetFloat(key string) (float64, error)

func GetInt

func GetInt(key string) (int, error)

func GetInt64

func GetInt64(key string) (int64, error)

func GetString

func GetString(key string) string

GetString

func Keys

func Keys(section string) []string

Keys 获取section下的所有keys

Types

type AppConfig

type AppConfig struct {
}

AppConfig 应用配置 使用了beego框架中读取配置文件的方式 文件需要放是conf/app.conf 或 conf/prod.app.conf 或 conf/dev.app.conf。

func (*AppConfig) GetBool

func (m *AppConfig) GetBool(key string, def bool) (v bool)

GetBool GetBool

func (*AppConfig) GetInt64

func (m *AppConfig) GetInt64(key string, def int64) (v int64)

GetInt GetInt

func (*AppConfig) GetString

func (m *AppConfig) GetString(key, def string) (v string)

GetString GetString

func (*AppConfig) RunMode

func (m *AppConfig) RunMode() (v string)

RunMode 返回dev 或 prod

Jump to

Keyboard shortcuts

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