config

package
v0.0.0-...-824d9a1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(path string)

LoadConfig 加载配置文件

Types

type Dynamic

type Dynamic struct {
	DynamicCfg
	// contains filtered or unexported fields
}

Dynamic 动态配置

type DynamicCfg

type DynamicCfg struct {
	WhiteList         []string `yaml:"white_list"`          // 地址白名单
	Suspended         bool     `yaml:"suspended"`           // 是否暂停服务
	MaxMemoLength     int      `yaml:"max_memo_length"`     // 备注最大长度
	AllowDeposit      bool     `yaml:"allow_deposit"`       // 是否允许充值
	AllowWithdraw     bool     `yaml:"allow_withdraw"`      // 是否允许提现
	RedEnvelopeExpire int64    `yaml:"red_envelope_expire"` // 红包过期时间
	UseFixedFee       bool     `yaml:"use_fixed_fee"`       // 是否使用固定手续费
	FixedFeeAmount    FeeCfg   `yaml:"fixed_fee_amount"`    // 固定手续费
}

DynamicCfg 配置数据

func GetDynamic

func GetDynamic() DynamicCfg

GetDynamic 获取动态配置

type FeeCfg

type FeeCfg struct {
	CNY uint32 `yaml:"cny"` // 人民币手续费
	USD uint32 `yaml:"usd"` // 美元手续费
}

FeeCfg 手续费配置

type Languges

type Languges struct {
	// contains filtered or unexported fields
}

Languges 语言包配置

func GetLanguge

func GetLanguge() *Languges

GetLanguge 获取语言配置

func NewLanguges

func NewLanguges() *Languges

NewLanguges 创建语言包

func (*Languges) Value

func (l *Languges) Value(code string, key string) string

Value 获取配置

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager 配置管理器

type MySQLCfg

type MySQLCfg struct {
	User     string            `yaml:"user"`     // 访问用户
	Password string            `yaml:"password"` // 访问密码
	Database string            `yaml:"db"`       // 数据库名
	Host     string            `yaml:"host"`     // 服务地址
	Conns    int               `yaml:"conns"`    // 连接数量
	Options  map[string]string `yaml:"options"`  // 附加选项
}

MySQLCfg MySQL配置

type Serve

type Serve struct {
	BindAddress       string   `yaml:"bind-address"`        // 绑定地址
	Port              uint16   `yaml:"port"`                // 端口号
	Domain            string   `yaml:"domain"`              // 服务域名
	APIWebsite        string   `yaml:"api_website"`         // API服务站点
	Token             string   `yaml:"token"`               // 机器人token
	BucketNum         uint32   `yaml:"bucket_num"`          // 记录桶数量
	Account           string   `yaml:"account"`             // 账户名称
	MySQL             MySQLCfg `yaml:"mysql"`               // 数据库配置
	WalletService     Service  `yaml:"wallet_service"`      // 钱包服务配置
	Dynamic           string   `yaml:"dynamic"`             // 动态文件配置
	BolTDBPath        string   `yaml:"boltdb_path"`         // BoltDB路径
	Languages         string   `yaml:"languages"`           // 语言配置路径
	RedEnvelopesCover []string `yaml:"red_envelopes_cover"` // 红包封面图
}

Serve 服务配置

func GetServe

func GetServe() Serve

GetServe 获取服务配置

type Service

type Service struct {
	Address string `yaml:"address"` // 地址
	Port    int    `yaml:"port"`    // 端口号
}

Service 服务配置

Jump to

Keyboard shortcuts

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