conf

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Conf = &Config{}
)

Conf global variable.

Functions

func Init

func Init() (err error)

Init create config instance.

Types

type Config

type Config struct {
	// base
	// host
	Host *Host
	// Env
	Env string
	// goroutine sleep
	Tick time.Duration
	// log
	Xlog *log.Config
	// databus
	DataBus *DataBus
	// bm service
	BM *bm.ServerConfig
	// httpClinet
	HTTPClient *bm.ClientConfig
	Mysql      *sql.Config
	Judge      *Judge
	Sms        *Sms
	Redis      *Redis
	Memcache   *Memcache
	// rpc client
	RPCClient *RPC
}

Config struct of conf.

type DataBus

type DataBus struct {
	CreditDBSub *databus.Config
	ReplyAllSub *databus.Config
	LabourSub   *databus.Config
}

DataBus databus config.

type Host

type Host struct {
	APICoURI     string
	AccountCoURI string
	MsgCoURI     string
}

Host config host.

type Judge

type Judge struct {
	ConfTimer          time.Duration // 定时load数据时间间隔
	ReservedTime       time.Duration // 结案前N分钟停止获取case
	CaseGiveHours      int64         // 案件发放时长
	CaseCheckTime      int64         // 单案审核时长
	JuryRatio          int64         // 投准率下限
	JudgeRadio         int64         // 判决阙值
	CaseVoteMin        int64         // 案件投票数下限
	CaseObtainMax      int64         // 每日获取案件数
	CaseVoteMax        int64         // 结案投票数
	JuryApplyMax       int64         // 每日发放风纪委上限
	CaseLoadMax        int           // 案件发放最大队列数
	CaseLoadSwitch     int8          // 案件发放进入队列开关
	CaseVoteMaxPercent int           // 结案投票数的百分比
	VoteNum
}

Judge is judge config.

type Memcache

type Memcache struct {
	*memcache.Config
	Expire time.Duration
}

Memcache memcache.

type RPC

type RPC struct {
	Archive *rpc.ClientConfig
	Member  *rpc.ClientConfig
}

RPC rpc client config.

type Redis

type Redis struct {
	*redis.Config
	Expire time.Duration
}

Redis redis conf.

type Sms

type Sms struct {
	Phone string
	Token string
}

Sms is sms monitor config.

type VoteNum

type VoteNum struct {
	RateS int8 `json:"rate_s"`
	RateA int8 `json:"rate_a"`
	RateB int8 `json:"rate_b"`
	RateC int8 `json:"rate_c"`
	RateD int8 `json:"rate_d"`
}

VoteNum struct.

Jump to

Keyboard shortcuts

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