conf

package
v0.0.0-...-44a0b5b Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SqliteDBPath = "prophet.db"
)

Variables

This section is empty.

Functions

func ValidClientConf

func ValidClientConf(cfg *Client) error

Types

type AppConf

type AppConf struct {
	Mode      Mode          `json:"mode" default:"prod" env:"mode"`
	Sentry    SentryConf    `json:"sentry"`
	PProf     PProfConf     `json:"pprof"`
	Log       LogConf       `json:"log" required:"true"`
	BuffApi   BuffApi       `json:"buffApi" required:"true"`
	CalcScore CalcScoreConf `json:"calcScore" required:"true"`
}

type BuffApi

type BuffApi struct {
	Url     string `json:"url"`
	Timeout int    `json:"timeout"`
}

type CalcScoreConf

type CalcScoreConf struct {
	Enabled            bool              `json:"enabled" default:"false"`
	FirstBlood         [2]float64        `json:"firstBlood" required:"true"`         // [击杀+,助攻+]
	PentaKills         [1]float64        `json:"pentaKills" required:"true"`         // 五杀
	QuadraKills        [1]float64        `json:"quadraKills" required:"true"`        // 四杀
	TripleKills        [1]float64        `json:"tripleKills" required:"true"`        // 三杀
	JoinTeamRateRank   [4]float64        `json:"joinTeamRate" required:"true"`       // 参团率排名
	GoldEarnedRank     [4]float64        `json:"goldEarned" required:"true"`         // 打钱排名
	HurtRank           [2]float64        `json:"hurtRank" required:"true"`           // 伤害排名
	Money2hurtRateRank [2]float64        `json:"money2HurtRateRank" required:"true"` // 金钱转换伤害比排名
	VisionScoreRank    [2]float64        `json:"visionScoreRank" required:"true"`    // 视野得分排名
	MinionsKilled      [][2]float64      `json:"minionsKilled" required:"true"`      // 补兵 [ [补兵数,加分数] ]
	KillRate           []RateItemConf    `json:"killRate" required:"true"`           // 人头占比
	HurtRate           []RateItemConf    `json:"hurtRate" required:"true"`           // 伤害占比
	AssistRate         []RateItemConf    `json:"assistRate" required:"true"`         // 助攻占比
	AdjustKDA          [2]float64        `json:"adjustKDA" required:"true"`          // kda
	Horse              [6]HorseScoreConf `json:"horse" required:"true"`
	MergeMsg           bool              `json:"mergeMsg"` // 是否合并消息为一条
}

type Client

type Client struct {
	AutoAcceptGame                 bool      `json:"autoAcceptGame"`                 // 自动接受
	AutoPickChampID                int       `json:"autoPickChampID"`                // 自动秒选
	AutoBanChampID                 int       `json:"autoBanChampID"`                 // 自动ban人
	AutoSendTeamHorse              bool      `json:"autoSendTeamHorse"`              // 是否自动发送消息到选人界面
	ShouldSendSelfHorse            bool      `json:"shouldSendSelfHorse"`            // 是否发送自己马匹信息
	HorseNameConf                  [6]string `json:"horseNameConf"`                  // 马匹名称配置
	ChooseSendHorseMsg             [6]bool   `json:"chooseSendHorseMsg"`             // 选择发送哪些马匹信息
	ChooseChampSendMsgDelaySec     int       `json:"chooseChampSendMsgDelaySec"`     // 选人阶段延迟几秒发送
	ShouldInGameSaveMsgToClipBoard bool      `json:"shouldInGameSaveMsgToClipBoard"` // 进入对局后保存敌方马匹消息到剪切板中
	ShouldAutoOpenBrowser          *bool     `json:"shouldAutoOpenBrowser"`          // 是否自动打开浏览器
}

type HorseScoreConf

type HorseScoreConf struct {
	Score float64 `json:"score,omitempty" required:"true"`
	Name  string  `json:"name" required:"true"`
}

type LogConf

type LogConf struct {
	Level      logger.LogLevelStr `json:"level" default:"info" env:"logLevel"`
	Filepath   string             `required:"true" json:"filepath" env:"logFilepath"`
	MaxSize    int                `default:"1024" env:"logMaxSize"`
	MaxBackups int                `default:"7" env:"logMaxBackups"`
	MaxAge     int                `default:"7" env:"logMaxAge"`
	Compress   bool               `default:"true" env:"logCompress"`
}

type Mode

type Mode = string
const (
	ModeDebug Mode = "debug"
	ModeProd  Mode = "prod"
)

type PProfConf

type PProfConf struct {
	Enable bool `default:"false" env:"enablePProf" json:"enable"`
}

type RateItemConf

type RateItemConf struct {
	Limit     float64      `json:"limit" required:"true"`     // >30%
	ScoreConf [][2]float64 `json:"scoreConf" required:"true"` // [ [最低人头限制,加分数] ]
}

type SentryConf

type SentryConf struct {
	Enabled bool   `json:"enabled" default:"false" env:"enableSentry"`
	Dsn     string `json:"dsn"`
}

type UpdateClientConfReq

type UpdateClientConfReq struct {
	AutoAcceptGame                 *bool      `json:"autoAcceptGame"`
	AutoPickChampID                *int       `json:"autoPickChampID"`
	AutoBanChampID                 *int       `json:"autoBanChampID"`
	AutoSendTeamHorse              *bool      `json:"autoSendTeamHorse"`
	ShouldSendSelfHorse            *bool      `json:"shouldSendSelfHorse"`
	HorseNameConf                  *[6]string `json:"horseNameConf"`
	ChooseSendHorseMsg             *[6]bool   `json:"chooseSendHorseMsg"`
	ChooseChampSendMsgDelaySec     *int       `json:"chooseChampSendMsgDelaySec"`
	ShouldInGameSaveMsgToClipBoard *bool      `json:"shouldInGameSaveMsgToClipBoard"`
	ShouldAutoOpenBrowser          *bool      `json:"shouldAutoOpenBrowser"`
}

Jump to

Keyboard shortcuts

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