Documentation
¶
Index ¶
- Constants
- Variables
- type File
- type ProcessConfig
- type ServerConfig
- func (c *ServerConfig) GetAutoDecrypt() bool
- func (c *ServerConfig) GetDataDir() string
- func (c *ServerConfig) GetDataKey() string
- func (c *ServerConfig) GetHTTPAddr() string
- func (c *ServerConfig) GetImgKey() string
- func (c *ServerConfig) GetPlatform() string
- func (c *ServerConfig) GetVersion() int
- func (c *ServerConfig) GetWebhook() *Webhook
- func (c *ServerConfig) GetWorkDir() string
- type TUIConfig
- type Webhook
- type WebhookItem
Constants ¶
View Source
const ( AppName = "chatlog" ServerConfigName = "chatlog-server" EnvPrefix = "CHATLOG" EnvConfigDir = "CHATLOG_DIR" )
View Source
const (
DefalutHTTPAddr = "0.0.0.0:5030"
)
Variables ¶
View Source
var DataDirConfigs = map[string]bool{ "type": true, "platform": true, "version": true, "full_version": true, "data_key": true, "img_key": true, }
View Source
var ServerDefaults = map[string]any{}
View Source
var TUIDefaults = map[string]any{}
Functions ¶
This section is empty.
Types ¶
type ProcessConfig ¶
type ProcessConfig struct {
Type string `mapstructure:"type" json:"type"`
Account string `mapstructure:"account" json:"account"`
Platform string `mapstructure:"platform" json:"platform"`
Version int `mapstructure:"version" json:"version"`
FullVersion string `mapstructure:"full_version" json:"full_version"`
DataDir string `mapstructure:"data_dir" json:"data_dir"`
DataKey string `mapstructure:"data_key" json:"data_key"`
ImgKey string `mapstructure:"img_key" json:"img_key"`
WorkDir string `mapstructure:"work_dir" json:"work_dir"`
HTTPEnabled bool `mapstructure:"http_enabled" json:"http_enabled"`
HTTPAddr string `mapstructure:"http_addr" json:"http_addr"`
LastTime int64 `mapstructure:"last_time" json:"last_time"`
Files []File `mapstructure:"files" json:"files"`
}
type ServerConfig ¶ added in v0.0.20
type ServerConfig struct {
Type string `mapstructure:"type"`
Platform string `mapstructure:"platform"`
Version int `mapstructure:"version"`
FullVersion string `mapstructure:"full_version"`
DataDir string `mapstructure:"data_dir"`
DataKey string `mapstructure:"data_key"`
ImgKey string `mapstructure:"img_key"`
WorkDir string `mapstructure:"work_dir"`
HTTPAddr string `mapstructure:"http_addr"`
AutoDecrypt bool `mapstructure:"auto_decrypt"`
Webhook *Webhook `mapstructure:"webhook"`
}
func LoadServiceConfig ¶ added in v0.0.20
func LoadServiceConfig(configPath string, cmdConf map[string]any) (*ServerConfig, *config.Manager, error)
LoadServiceConfig 加载服务配置
func (*ServerConfig) GetAutoDecrypt ¶ added in v0.0.20
func (c *ServerConfig) GetAutoDecrypt() bool
func (*ServerConfig) GetDataDir ¶ added in v0.0.20
func (c *ServerConfig) GetDataDir() string
func (*ServerConfig) GetDataKey ¶ added in v0.0.20
func (c *ServerConfig) GetDataKey() string
func (*ServerConfig) GetHTTPAddr ¶ added in v0.0.20
func (c *ServerConfig) GetHTTPAddr() string
func (*ServerConfig) GetImgKey ¶ added in v0.0.20
func (c *ServerConfig) GetImgKey() string
func (*ServerConfig) GetPlatform ¶ added in v0.0.20
func (c *ServerConfig) GetPlatform() string
func (*ServerConfig) GetVersion ¶ added in v0.0.20
func (c *ServerConfig) GetVersion() int
func (*ServerConfig) GetWebhook ¶ added in v0.0.25
func (c *ServerConfig) GetWebhook() *Webhook
func (*ServerConfig) GetWorkDir ¶ added in v0.0.20
func (c *ServerConfig) GetWorkDir() string
type TUIConfig ¶ added in v0.0.20
type TUIConfig struct {
ConfigDir string `mapstructure:"-" json:"config_dir"`
LastAccount string `mapstructure:"last_account" json:"last_account"`
History []ProcessConfig `mapstructure:"history" json:"history"`
Webhook *Webhook `mapstructure:"webhook" json:"webhook"`
}
func LoadTUIConfig ¶ added in v0.0.20
LoadTUIConfig 加载 TUI 配置
func (*TUIConfig) ParseHistory ¶ added in v0.0.20
func (c *TUIConfig) ParseHistory() map[string]ProcessConfig
type Webhook ¶ added in v0.0.25
type Webhook struct {
Host string `mapstructure:"host"`
DelayMs int64 `mapstructure:"delay_ms"`
Items []*WebhookItem `mapstructure:"items"`
}
Click to show internal directories.
Click to hide internal directories.