Documentation
¶
Index ¶
Constants ¶
const LogFileMB = 10
LogFileMB 是单个日志文件的轮转大小
const WAABackendCamoufox = "camoufox"
WAABackendCamoufox 表示由 Camoufox 页面承担 WAA 生命周期
const WAABackendGo = "go"
WAABackendGo 表示由纯 Go VM 承担 WAA 生命周期
Variables ¶
This section is empty.
Functions ¶
func ParseUpstreamChannels ¶ added in v0.2.0
ParseUpstreamChannels 把逗号分隔的通道列表拆成去空白的小写名称
Types ¶
type Config ¶
type Config struct {
AutoStart bool `json:"auto_start"`
RequestBodyLog bool `json:"request_body_log"`
LogFile bool `json:"log_file"`
LogMaxTotalMB int `json:"log_max_total_mb"`
AdminAuthEnabled bool `json:"admin_auth_enabled"`
AdminUsername string `json:"admin_username"`
AdminPassword string `json:"-"`
BuildNativeNonstream bool `json:"build_native_nonstream"`
AuthStates string `json:"auth_states"`
ListenAddr string `json:"listen_addr"`
ProxyAPIKey string `json:"proxy_api_key"`
Proxy string `json:"proxy"`
InitTimeout time.Duration `json:"-"`
RequestTimeout time.Duration `json:"-"`
WarmWorkerLimit int `json:"warm_worker_limit"`
MaxActiveWorkers int `json:"max_active_workers"`
WarmStartupConcurrency int `json:"warm_startup_concurrency"`
PerAccountConcurrency int `json:"per_account_concurrency"`
RoutingStrategy string `json:"routing_strategy"`
UpstreamChannels []string `json:"upstream_channels"`
ModelMapping string `json:"model_mapping"`
TemporaryChat bool `json:"temporary_chat"`
WAABackend string `json:"waa_backend"`
}
Config 保存服务的全局配置
func (Config) MarshalJSON ¶
MarshalJSON 将时长输出为 env 使用的文本格式
func (*Config) UnmarshalJSON ¶
UnmarshalJSON 从管理接口使用的文本时长解析配置
type ModelAlias ¶ added in v0.2.11
ModelAlias 表示客户端模型名到目录模型 ID 的一项映射
func ParseModelMapping ¶ added in v0.2.11
func ParseModelMapping(value string) ([]ModelAlias, error)
ParseModelMapping 解析逗号分隔的 别名:模型 ID,别名可含冒号,以最后一个冒号分隔