Documentation
¶
Index ¶
- Variables
- func GetAutoRegistration() bool
- func GetBlackCmd() map[string]bool
- func GetDataPath() string
- func GetGucooingApiKey() string
- func GetIsLite() bool
- func GetIsLogMsgPlayer() bool
- func GetResourcesPath() string
- func GetTutorial() bool
- func LoadConfig(filePath string) error
- func SetDefaultConfig()
- type Bot
- type Config
- type DB
- type GateWay
- type HttpNet
- type Irc
- type Mail
- type OtherAddr
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = &Config{ IsLite: false, LogLevel: "Info", Language: "", ResourcesPath: "./resources", DataPath: "./data", GucooingApiKey: mx.GetMxToken(0, 32), AutoRegistration: true, Tutorial: false, OtherAddr: &OtherAddr{ ServerInfoUrl: "https://yostar-serverinfo.bluearchiveyostar.com", ManagementDataUrl: "https://prod-noticeindex.bluearchiveyostar.com/prod/index.json", }, HttpNet: &HttpNet{ InnerIp: "0.0.0.0", InnerPort: "5000", OuterAddr: "http://127.0.0.1:5000", Tls: false, CertFile: "./config/cert.pem", KeyFile: "./config/key.pem", Encoding: true, }, GateWay: &GateWay{ MaxPlayerNum: 0, MaxCachePlayerTime: 10, BlackCmd: make(map[string]bool), IsLogMsgPlayer: false, }, DB: &DB{ DbType: "sqlite", Dsn: "./sqlite/BaPs.db", }, RankDB: &DB{ DbType: "sqlite", Dsn: "./sqlite/Rank.db", }, Irc: &Irc{ HostAddress: "127.0.0.1", Port: 16666, Password: "mx123", }, Mail: &Mail{ Enable: false, Username: "gucooing@BaPs.com", Password: "gucooing", Host: "BaPs.com", Port: 587, }, }
View Source
var FileNotExist = errors.New("config file not found")
Functions ¶
func GetAutoRegistration ¶
func GetAutoRegistration() bool
func GetBlackCmd ¶
func GetDataPath ¶
func GetDataPath() string
func GetGucooingApiKey ¶
func GetGucooingApiKey() string
func GetIsLogMsgPlayer ¶
func GetIsLogMsgPlayer() bool
func GetResourcesPath ¶
func GetResourcesPath() string
func GetTutorial ¶
func GetTutorial() bool
func LoadConfig ¶
func SetDefaultConfig ¶
func SetDefaultConfig()
Types ¶
type Bot ¶
type Config ¶
type Config struct {
IsLite bool `json:"IsLite"`
LogLevel string `json:"LogLevel"`
Language string `json:"Language"`
ResourcesPath string `json:"ResourcesPath"`
DataPath string `json:"DataPath"`
GucooingApiKey string `json:"GucooingApiKey"`
AutoRegistration bool `json:"AutoRegistration"`
Tutorial bool `json:"Tutorial"`
OtherAddr *OtherAddr `json:"OtherAddr"`
HttpNet *HttpNet `json:"HttpNet"`
GateWay *GateWay `json:"GateWay"`
DB *DB `json:"DB"`
Irc *Irc `json:"Irc"`
RankDB *DB `json:"RankDB"`
Mail *Mail `json:"Mail"`
Bot *Bot `json:"Bot"`
}
type GateWay ¶
type GateWay struct {
MaxPlayerNum int64 `json:"MaxPlayerNum"`
MaxCachePlayerTime int `json:"MaxCachePlayerTime"`
BlackCmd map[string]bool `json:"BlackCmd"`
IsLogMsgPlayer bool `json:"IsLogMsgPlayer"`
}
func GetGateWay ¶
func GetGateWay() *GateWay
type HttpNet ¶
type HttpNet struct {
InnerIp string `json:"InnerIp"`
InnerPort string `json:"InnerPort"`
OuterAddr string `json:"OuterAddr"`
Tls bool `json:"Tls"`
CertFile string `json:"CertFile"`
KeyFile string `json:"KeyFile"`
Encoding bool `json:"Encoding"`
}
func GetHttpNet ¶
func GetHttpNet() *HttpNet
func (*HttpNet) GetOuterAddr ¶
type Irc ¶
type Mail ¶
type OtherAddr ¶
type OtherAddr struct {
ServerInfoUrl string `json:"ServerInfoUrl"`
ManagementDataUrl string `json:"ManagementDataUrl"`
}
func GetOtherAddr ¶
func GetOtherAddr() *OtherAddr
func (*OtherAddr) GetManagementDataUrl ¶
func (*OtherAddr) GetServerInfoUrl ¶
Click to show internal directories.
Click to hide internal directories.