conf

package
v0.0.0-...-54421ad Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: BSD-3-Clause Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(filename string, conf interface{})

加载 配置文件,只加载一次,全局单例

Types

type Config

type Config struct {
	Rpc   ConfigRpc // node rpc
	Rds   ConfigRedis
	Mysql ConfigMysql
	Trade ConfigTrade
}

func GetConfig

func GetConfig() Config

获取配置对象

type ConfigMysql

type ConfigMysql struct {
	Host     string
	Database string
}

type ConfigRedis

type ConfigRedis struct {
	Host      string
	DB        int
	MaxIdle   int
	MaxActive int
	Auth      string
}

***

reids配置

type ConfigRpc

type ConfigRpc struct {
	Addr    string // listen at
	Pattern string // http handler pattern

}

**

rpc 配置

type ConfigTrade

type ConfigTrade struct {
	TransferFeeSZ float64
	TransferFeeSH float64
	StampTax      float64
	Brokerage     float64
}

**

交易规则相关配置

Jump to

Keyboard shortcuts

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