Documentation ¶
Index ¶
- Variables
- func AccessLogger() *zap.Logger
- func Load(filename string) (*toml.Tree, error)
- func Logger() *zap.Logger
- func Parse(filename string, v interface{}) error
- func ReloadConfigHandler()
- func Setup(options ProjectOptions)
- func SetupConfig(filename string, conf interface{})
- func SugarLogger() *zap.SugaredLogger
- type LoggerOptions
- type ProjectOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProjectName = "" ModuleName = "" RootPath = "" ConfigPath = "" LogsPath = "" AssetsPath = "" RunPath = "" TmpPath = "" )
View Source
var (
ErrInvalidParseConfig = errors.New("conf param must be a pointer type")
)
Functions ¶
func AccessLogger ¶
func ReloadConfigHandler ¶
func ReloadConfigHandler()
func Setup ¶
func Setup(options ProjectOptions)
func SetupConfig ¶
func SetupConfig(filename string, conf interface{})
func SugarLogger ¶
func SugarLogger() *zap.SugaredLogger
Types ¶
type LoggerOptions ¶
type ProjectOptions ¶
type ProjectOptions struct { Name string Module string RootPath string Env string // 环境标识,dev: 开发环境;test:测试环境;prod:生产环境; ConfigFilename string // 配置文件,若未指定,则默认为 {ConfigPath}/app.{Env}.toml Config interface{} // 接收配置数据的参数 LoggerOptions *LoggerOptions AccessLoggerOptions *LoggerOptions }
Click to show internal directories.
Click to hide internal directories.