airobot/storage/config.go
2022-12-13 20:11:05 +08:00

38 lines
1.4 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package storage
//默认配置
func newDefaultConfig() *Config {
return &Config{}
}
type Config struct {
Global *Global `json:"global"`
Scenes []*Scene `json:"scenes"`
}
type Global struct {
UserCount uint32 `json:"UserCount,omitempty"` //用户数(每次压入的数量)
UserCountTotal uint32 `json:"UserCountTotal,omitempty"` //用户总数(压入的总数)
SId string `json:"sid,omitempty"` //区服ID
WsAddr string `json:"wsAddr,omitempty"` //websocket addr
IntervalS int32 `json:"intervalS,omitempty"` //间隔时间s每次压入用户的间隔时间
TimeoutMs int32 `json:"timeoutMs,omitempty"` //超时时间 (请求超时时间)
}
type Scene struct {
ID string `json:"id,omitempty"` //场景ID
Name string `json:"name,omitempty"` //场景名称
Desc string `json:"desc,omitempty"` //描述
Callers []*Caller `json:"callers,omitempty"` //调用器列表
Status uint32 `json:"status,omitempty"` //是否启用 默认0未启用 1是启用
Num int `json:"num,omitempty"` //顺序号
Loop int32 `json:"loop,omitempty"` //循环次数
}
type Caller struct {
ID string `json:"id,omitempty"` //调用器ID
Name string `json:"name,omitempty"` //调用器名称
Key string `json:"key,omitempty"` //标识
Num int `json:"num,omitempty"` //顺序号
}