conf

package
v0.0.0-20201105-01 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DebugLevel logs are typically voluminous, and are usually disabled in
	// production.
	DebugLevel zapcore.Level = iota - 1
	// InfoLevel is the default logging priority.
	InfoLevel
	// WarnLevel logs are more important than Info, but don't need individual
	// human review.
	WarnLevel
	// ErrorLevel logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	ErrorLevel
	// DPanicLevel logs are particularly important errors. In development the
	// logger panics after writing the message.
	DPanicLevel
	// PanicLevel logs a message, then panics.
	PanicLevel
	// FatalLevel logs a message, then calls os.Exit(1).
	FatalLevel
)

Variables

View Source
var Conf *viper.Viper

Functions

func Init

func Init() error

Types

type DbConf

type DbConf struct {
	DbType     string
	DefaultDsn string
}

数据库配置

func LoadDatabase

func LoadDatabase() *DbConf

type LogConf

type LogConf struct {
	LogLevel zapcore.Level
	LogPath  string
}

日志配置

func LoadLog

func LoadLog() *LogConf

type RedisConf

type RedisConf struct {
	RedisDefaultHost      string
	RedisDefaultInitConns int
	RedisDefaultMaxConns  int
}

Redis配置

func LoadRedis

func LoadRedis() *RedisConf

type ServerConf

type ServerConf struct {
	HttpPost string
}

Server配置

func LoadServer

func LoadServer() *ServerConf

type TokenConf

type TokenConf struct {
	TokenHeader     string
	TokenSecret     string
	TokenExpireTime time.Duration
}

func LoadToken

func LoadToken() *TokenConf

Jump to

Keyboard shortcuts

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