config

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppInfoConfiguration

type AppInfoConfiguration struct {
	AppId uint `mapstructure:"app_id"`
}

type Configuration

type Configuration struct {
	JWT             JWTConfiguration
	Server          ServerConfiguration
	DB              DatabaseConfiguration `mapstructure:"database"`
	Redis           RedisConfiguration    `mapstructure:"redis"`
	DumpRepResp     bool                  `mapstructure:"dump_request_response"`
	DebugSQL        bool                  `mapstructure:"debug_sql"`
	NewRelicLicense string                `mapstructure:"new_relic_license"`
	VerifySign      string                `mapstructure:"verify_sign"`
	Submail         SubmailConfiguration  `mapstructure:"submail"`
	WXPay           WXPayConfiguration    `mapstructure:"wxpay"`
	AppInfo         AppInfoConfiguration  `mapstructure:"appinfo"`
}

func Init

func Init() *Configuration

Init - Initialization config options. Read the config file from the current directory and marshal into the conf config struct.

type DatabaseConfiguration

type DatabaseConfiguration struct {
	Adapter  string
	Host     string
	Port     int
	Username string
	Password string
	Name     string
	Charset  string
}

type JWTConfiguration

type JWTConfiguration struct {
	Realm string
	Key   string
}

type RedisConfiguration

type RedisConfiguration struct {
	Host     string
	Port     int
	Password string
}

type ServerConfiguration

type ServerConfiguration struct {
	Port int
	Mode string
}

type SubmailConfiguration

type SubmailConfiguration struct {
	ID  string
	Key string
}

type WXPayConfiguration

type WXPayConfiguration struct {
	AppID      string `mapstructure:"app_id"`
	MchID      string `mapstructure:"mch_id"`
	APIKey     string `mapstructure:"api_key"`
	CertFile   string `mapstructure:"cert_file"`
	KeyFile    string `mapstructure:"key_file"`
	Pkcs12File string `mapstructure:"pkcs12_file"`
}

Jump to

Keyboard shortcuts

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