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: 18 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
	// log
	Xlog *log.Config
	// AuthN
	AuthN *auth.Config
	// Verify
	Verify *verify.Config
	// http
	BM *HTTPServers

	// db
	Mysql *sql.Config
	// mc
	Memcache *Memcache
	//redis
	Redis *Redis
	// databus
	DataBus *databus.Config
	// tracer
	Tracer *trace.Config

	// bm client
	HTTPClient *bm.ClientConfig
	// Judge conf
	Judge *Judge
	// ecodes
	Ecode *ecode.Config
	// Antispam
	Antispam *antispam.Config
	// TagID
	TagID *TagID
	// Property
	Property *Property
	// rpc client
	RPCClient2 *RPC
	//  GRPCClient
	GRPCClient *GRPC
}

Config struct of conf.

type GRPC

type GRPC struct {
	Filter  *warden.ClientConfig
	Account *warden.ClientConfig
}

GRPC .

type HTTPServers

type HTTPServers struct {
	Inner *bm.ServerConfig
	Local *bm.ServerConfig
}

HTTPServers Http Servers

type Host

type Host struct {
	MessageURI  string
	BigDataURI  string
	APICoURI    string
	ManagersURI string
}

Host define host conf.

type Judge

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

Judge define judge conf.

type Memcache

type Memcache struct {
	*memcache.Config
	UserExpire      time.Duration
	MinCommonExpire time.Duration
	CommonExpire    time.Duration
}

Memcache define memcache conf.

type Property

type Property struct {
	QsNum    int
	PerScore int64
}

Property .

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 define redis conf.

type TagID

type TagID struct {
	Reply    int64
	DM       int64
	Msg      int64
	Tag      int64
	Member   int64
	Archive  int64
	Music    int64
	Article  int64
	SpaceTop int64
}

TagID is workflow id .

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 .

Jump to

Keyboard shortcuts

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