config

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_LogResponse    = true
	DEFAULT_LogRequestBody = true
	DEFAULT_LogLevel       = 1 //info
	DEFAULT_LogInnerLevel  = 1
	DEFAULT_LogClient      = true
	DEFAULT_ServerPort     = 8080
	DEFAULT_DB_Charset     = "utf8"
	DEFAULT_DB_MaxConn     = 1000
	DEFAULT_DB_MaxIdleConn = 500
)
View Source
const (
	BuildinValueLog            = "Value.Log"
	BuildinValueLogResponse    = "Value.Log.ResponseBody"
	BuildinValueLogRequestBody = "Value.Log.RequestBody"
	BuildinValueLogLevel       = "Value.Log.Level"
	BuildinValueLogInnerLevel  = "Value.Log.InnerLevel"
	BuildinValueLogClient      = "Value.Log.Client"

	BuildinValueServer     = "Value.Server"
	BuildinValueServerPort = "Value.Server.Port"
)

Variables

View Source
var GConfig = gDefaultConfig

Functions

func LoadConfig

func LoadConfig(path string, destConfig *Config) error

func LoadDefault

func LoadDefault(config *Config)

func LoadFromSetting added in v0.0.11

func LoadFromSetting(setting setting.Setting) error

func ParseConfig added in v0.0.9

func ParseConfig(data []byte, props map[string]string, destConfig *Config) error

func ResetConfig

func ResetConfig(config Config)

Types

type Config

type Config struct {
	Env            string
	LogResponse    bool
	LogRequestBody bool
	LogWriter      io.Writer
	LogLevel       int
	LogInnerLevel  int
	LogClient      bool

	ServerPort int
}

func Default

func Default() Config

func ReadArgs

func ReadArgs() Config

type LogConfig added in v0.0.11

type LogConfig struct {
	ResponseBody bool
	RequestBody  bool
	Level        string
	InnerLevel   string
	Client       bool
}

type ServerConfig added in v0.0.11

type ServerConfig struct {
	Port int
}

Jump to

Keyboard shortcuts

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