config

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 6 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
)

Variables

View Source
var GConfig = gDefaultConfig

Functions

func LoadConfig

func LoadConfig(path string, destConfig *Config) error

func LoadDefault

func LoadDefault(config *Config)

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

	DataSources map[string]*DataSource
}

func Default

func Default() Config

func ReadArgs

func ReadArgs() Config

type DataSource

type DataSource struct {
	Host     string
	Port     int
	DBName   string
	Username string
	Password string
	Charset  string

	MaxConn     int
	MaxIdleConn int
}

Jump to

Keyboard shortcuts

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