Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GlobalStore *lingstorage.Client
Functions ¶
Types ¶
type Config ¶
type Config struct {
Server ServerConfig `mapstructure:"server"`
Database DatabaseConfig `mapstructure:"database"`
Log logger.LogConfig `mapstructure:"log"`
Services ServicesConfig `mapstructure:"services"`
}
Config 应用主配置(精简版:仅服务、数据库、日志与 LLM)。
var GlobalConfig *Config
GlobalConfig 进程级单例,在 Load 成功后可用。
type DatabaseConfig ¶
DatabaseConfig 数据库连接。
type LLMConfig ¶
type LLMConfig struct {
Provider string `env:"LLM_PROVIDER"` // openai | ollama | lmstudio 等,走 OpenAI 兼容 Chat Completions
APIKey string `env:"LLM_API_KEY"`
BaseURL string `env:"LLM_BASE_URL"`
Model string `env:"LLM_MODEL"`
}
LLMConfig 大模型调用(供后续引擎使用)。
type ServerConfig ¶
type ServerConfig struct {
Name string `env:"SERVER_NAME"`
Addr string `env:"ADDR"`
Mode string `env:"MODE"`
APIPrefix string `env:"API_PREFIX"`
}
ServerConfig HTTP 服务相关。
type ServicesConfig ¶
type ServicesConfig struct {
LLM LLMConfig `mapstructure:"llm"`
Storage StorageConfig `mapstructure:"storage"`
}
ServicesConfig 外部服务。
Click to show internal directories.
Click to hide internal directories.