Documentation
¶
Index ¶
- type Attachment
- type ClickHouse
- type Config
- func (c *Config) GetGiteaBaseURL() string
- func (c *Config) GetGiteaOAuthClientID() string
- func (c *Config) GetGiteaOAuthClientSecret() string
- func (c *Config) GetGiteaOAuthRedirectURL() string
- func (c *Config) GetGiteaToken() string
- func (c *Config) GetGiteeBaseURL() string
- func (c *Config) GetGiteeOAuthClientID() string
- func (c *Config) GetGiteeOAuthClientSecret() string
- func (c *Config) GetGiteeOAuthRedirectURL() string
- func (c *Config) GetGiteeToken() string
- func (c *Config) GetGitlabBaseURL(instanceName string) string
- func (c *Config) GetGitlabOAuthClientID(instanceName string) string
- func (c *Config) GetGitlabOAuthClientSecret(instanceName string) string
- func (c *Config) GetGitlabOAuthRedirectURL(instanceName string) string
- func (c *Config) GetGitlabOAuthScope(instanceName string) string
- func (c *Config) GetGitlabToken(instanceName string) string
- func (c *Config) IsGiteaEnabled() bool
- func (c *Config) IsGiteeEnabled() bool
- func (c *Config) IsGithubEnabled() bool
- func (c *Config) IsGitlabInstanceEnabled(instanceName string) bool
- type Database
- type GiteaConfig
- type GiteaOAuthConfig
- type GiteeConfig
- type GiteeOAuthConfig
- type GithubAppConfig
- type GithubConfig
- type GithubOAuthConfig
- type GitlabConfig
- type GitlabInstance
- type GitlabOAuthConfig
- type HostInstaller
- type InitTeam
- type LLM
- type Loki
- type MCPHub
- type NLS
- type Notify
- type ObjectStorageConfig
- type PublicHost
- type ReviewAgent
- type SMTP
- type Session
- type StaticFilesConfig
- type Task
- type TaskFlow
- type TaskSummary
- type VMIdle
- type WechatConfig
- type WechatMPConfig
- type WechatOpenConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct {
AllowedURLPrefixes []string `mapstructure:"allowed_url_prefixes"`
}
type ClickHouse ¶
type ClickHouse struct {
Addr string `mapstructure:"addr"`
Database string `mapstructure:"database"`
Table string `mapstructure:"table"`
InitEnabled bool `mapstructure:"init_enabled"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
ReadUsername string `mapstructure:"read_username"`
ReadPassword string `mapstructure:"read_password"`
MaxOpenConns int `mapstructure:"max_open_conns"`
MaxIdleConns int `mapstructure:"max_idle_conns"`
ConnMaxLifetime int `mapstructure:"conn_max_lifetime"`
}
type Config ¶
type Config struct {
Debug bool `mapstructure:"debug"`
Server struct {
Addr string `mapstructure:"addr"`
BaseURL string `mapstructure:"base_url"`
} `mapstructure:"server"`
Database Database `mapstructure:"database"`
Redis struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
Pass string `mapstructure:"pass"`
DB int `mapstructure:"db"`
} `mapstructure:"redis"`
Session Session `mapstructure:"session"`
SMTP SMTP `mapstructure:"smtp"`
LLMProxy struct {
Addr string `mapstructure:"addr"`
BaseURL string `mapstructure:"base_url"`
Timeout string `mapstructure:"timeout"`
KeepAlive string `mapstructure:"keep_alive"`
ClientPoolSize int `mapstructure:"client_pool_size"`
StreamClientPoolSize int `mapstructure:"stream_client_pool_size"`
RequestLogPath string `mapstructure:"request_log_path"`
} `mapstructure:"llm_proxy"`
RootPath string `mapstructure:"root_path"`
Logger logger.Config `mapstructure:"logger"`
AdminToken string `mapstructure:"admin_token"`
Proxies []string `mapstructure:"proxies"`
TaskFlow TaskFlow `mapstructure:"taskflow"`
MCPHub MCPHub `mapstructure:"mcp_hub"`
PublicHost PublicHost `mapstructure:"public_host"`
Task Task `mapstructure:"task"`
TaskSummary TaskSummary `mapstructure:"task_summary"`
Loki Loki `mapstructure:"loki"`
ClickHouse ClickHouse `mapstructure:"clickhouse"`
LLM LLM `mapstructure:"llm"`
Notify Notify `mapstructure:"notify"`
VMIdle VMIdle `mapstructure:"vm_idle"`
Attachment Attachment `mapstructure:"attachment"`
ObjectStorage ObjectStorageConfig `mapstructure:"object_storage"`
StaticFiles StaticFilesConfig `mapstructure:"static_files"`
HostInstaller HostInstaller `mapstructure:"host_installer"`
// Context7 API 配置
Context7ApiKey string `mapstructure:"context7_api_key"`
// Git 平台配置
Github GithubConfig `mapstructure:"github"`
Gitlab GitlabConfig `mapstructure:"gitlab"`
Gitea GiteaConfig `mapstructure:"gitea"`
Gitee GiteeConfig `mapstructure:"gitee"`
// 微信配置(开放平台 OAuth 登录 + 公众号消息推送)
Wechat WechatConfig `mapstructure:"wechat"`
InitTeam InitTeam `mapstructure:"init_team"`
// 语音识别配置(阿里云 NLS)
NLS NLS `mapstructure:"nls"`
ReviewAgent ReviewAgent `mapstructure:"review_agent"`
}
func (*Config) GetGiteaBaseURL ¶
GetGiteaBaseURL 获取 Gitea Base URL
func (*Config) GetGiteaOAuthClientID ¶
GetGiteaOAuthClientID 获取 Gitea OAuth Client ID
func (*Config) GetGiteaOAuthClientSecret ¶
GetGiteaOAuthClientSecret 获取 Gitea OAuth Client Secret
func (*Config) GetGiteaOAuthRedirectURL ¶
GetGiteaOAuthRedirectURL 获取 Gitea OAuth Redirect URL
func (*Config) GetGiteeBaseURL ¶
GetGiteeBaseURL 获取 Gitee Base URL
func (*Config) GetGiteeOAuthClientID ¶
GetGiteeOAuthClientID 获取 Gitee OAuth Client ID
func (*Config) GetGiteeOAuthClientSecret ¶
GetGiteeOAuthClientSecret 获取 Gitee OAuth Client Secret
func (*Config) GetGiteeOAuthRedirectURL ¶
GetGiteeOAuthRedirectURL 获取 Gitee OAuth Redirect URL
func (*Config) GetGitlabBaseURL ¶
GetGitlabBaseURL 获取指定 GitLab 实例的 Base URL
func (*Config) GetGitlabOAuthClientID ¶
GetGitlabOAuthClientID 获取指定 GitLab 实例的 OAuth Client ID
func (*Config) GetGitlabOAuthClientSecret ¶
GetGitlabOAuthClientSecret 获取指定 GitLab 实例的 OAuth Client Secret
func (*Config) GetGitlabOAuthRedirectURL ¶
GetGitlabOAuthRedirectURL 获取指定 GitLab 实例的 OAuth Redirect URL
func (*Config) GetGitlabOAuthScope ¶
GetGitlabOAuthScope 获取指定 GitLab 实例的 OAuth Scope
func (*Config) GetGitlabToken ¶
GetGitlabToken 获取 GitLab token
func (*Config) IsGithubEnabled ¶
IsGithubEnabled 检查 GitHub 是否启用
func (*Config) IsGitlabInstanceEnabled ¶
IsGitlabInstanceEnabled 检查指定 GitLab 实例是否启用
type GiteaConfig ¶
type GiteaConfig struct {
BaseURL string `mapstructure:"base_url"`
Token string `mapstructure:"token"`
Enabled bool `mapstructure:"enabled"`
OAuth GiteaOAuthConfig `mapstructure:"oauth"`
}
GiteaConfig Gitea 配置
type GiteaOAuthConfig ¶
type GiteaOAuthConfig struct {
ClientID string `mapstructure:"client_id"`
ClientSecret string `mapstructure:"client_secret"`
RedirectURL string `mapstructure:"redirect_url"`
}
GiteaOAuthConfig Gitea OAuth 配置
type GiteeConfig ¶
type GiteeConfig struct {
BaseURL string `mapstructure:"base_url"`
Token string `mapstructure:"token"`
Enabled bool `mapstructure:"enabled"`
OAuth GiteeOAuthConfig `mapstructure:"oauth"`
}
GiteeConfig Gitee 配置
type GiteeOAuthConfig ¶
type GiteeOAuthConfig struct {
ClientID string `mapstructure:"client_id"`
ClientSecret string `mapstructure:"client_secret"`
RedirectURL string `mapstructure:"redirect_url"`
}
GiteeOAuthConfig Gitee OAuth 配置
type GithubAppConfig ¶
type GithubConfig ¶
type GithubConfig struct {
Token string `mapstructure:"token"`
Enabled bool `mapstructure:"enabled"`
App GithubAppConfig `mapstructure:"app"`
OAuth GithubOAuthConfig `mapstructure:"oauth"`
}
GithubConfig GitHub 配置
type GithubOAuthConfig ¶
type GithubOAuthConfig struct {
ClientID string `mapstructure:"client_id"`
ClientSecret string `mapstructure:"client_secret"`
RedirectURL string `mapstructure:"redirect_url"`
}
GithubOAuthConfig GitHub OAuth 配置
type GitlabConfig ¶
type GitlabConfig struct {
Default string `mapstructure:"default"`
Instances map[string]GitlabInstance `mapstructure:"instances"`
WebhookSecret string `mapstructure:"webhook_secret"`
AllowedDomains []string `mapstructure:"allowed_domains"`
}
GitlabConfig GitLab 配置
type GitlabInstance ¶
type GitlabInstance struct {
Token string `mapstructure:"token"`
BaseURL string `mapstructure:"base_url"`
Enabled bool `mapstructure:"enabled"`
OAuth GitlabOAuthConfig `mapstructure:"oauth"`
}
GitlabInstance GitLab 实例配置
type GitlabOAuthConfig ¶
type GitlabOAuthConfig struct {
ClientID string `mapstructure:"client_id"`
ClientSecret string `mapstructure:"client_secret"`
RedirectURL string `mapstructure:"redirect_url"`
Scope []string `mapstructure:"scope"`
}
GitlabOAuthConfig GitLab OAuth 配置
type HostInstaller ¶
type LLM ¶
type LLM struct {
BaseURL string `mapstructure:"base_url"`
APIKey string `mapstructure:"api_key"`
Model string `mapstructure:"model"`
InterfaceType string `mapstructure:"interface_type"` // openai_chat, openai_responses, anthropic
}
LLM 大语言模型配置
type NLS ¶
type NLS struct {
AppKey string `mapstructure:"app_key"`
AkID string `mapstructure:"ak_id"`
AkKey string `mapstructure:"ak_key"`
}
NLS 阿里云语音识别配置
type Notify ¶
type Notify struct {
VMExpireWarningMinutes int `mapstructure:"vm_expire_warning_minutes"` // VM 过期预警时间(分钟)
}
Notify 通知配置
type ObjectStorageConfig ¶
type ObjectStorageConfig struct {
Enabled bool `mapstructure:"enabled"`
Provider string `mapstructure:"provider"`
ForcePathStyle bool `mapstructure:"force_path_style"`
InitBucket bool `mapstructure:"init_bucket"`
PresignExpires string `mapstructure:"presign_expires"`
Endpoint string `mapstructure:"endpoint"`
AccessEndpoint string `mapstructure:"access_endpoint"`
AccessKey string `mapstructure:"access_key"`
AccessKeySecret string `mapstructure:"access_key_secret"`
Bucket string `mapstructure:"bucket"`
Region string `mapstructure:"region"`
MaxSize int64 `mapstructure:"max_size"`
AvatarPrefix string `mapstructure:"avatar_prefix"`
SpecPrefix string `mapstructure:"spec_prefix"`
RepoPrefix string `mapstructure:"repo_prefix"`
TempPrefix string `mapstructure:"temp_prefix"`
}
type PublicHost ¶
type PublicHost struct {
CountLimit int `mapstructure:"count_limit"` // 每用户公共主机 VM 数量限制,0 表示不限制
TTLLimit int64 `mapstructure:"ttl_limit"` // 公共主机 VM 续期上限(秒),0 表示不限制
}
PublicHost 公共主机配置(可选,内部项目通过 WithPublicHost 注入时生效)
type ReviewAgent ¶
type StaticFilesConfig ¶
type Task ¶
type Task struct {
LogLimit int `mapstructure:"log_limit"` // Loki tail 日志 limit
TaskerTTLSeconds int `mapstructure:"tasker_ttl_seconds"` // Tasker 状态机 TTL(秒)
ImageID string `mapstructure:"image_id"` // 默认镜像 ID
Core int `mapstructure:"core"` // VM CPU 核数
Memory uint64 `mapstructure:"memory"` // VM 内存(字节)
}
Task 任务相关配置
type TaskSummary ¶
type TaskSummary struct {
Enabled bool `mapstructure:"enabled"` // 是否启用
Model string `mapstructure:"model"` // 摘要生成模型 ID
BaseURL string `mapstructure:"base_url"` // API Base URL
ApiKey string `mapstructure:"api_key"` // API Key // nolint:revive
InterfaceType string `mapstructure:"interface_type"` // API 接口类型(openai_chat/openai_responses/anthropic)
Delay int `mapstructure:"delay"` // 延迟时间(秒),默认 3600
MaxChars int `mapstructure:"max_chars"` // 摘要最大字符数,默认 300
MaxRounds int `mapstructure:"max_rounds"` // 最近对话轮数,默认 3
MaxWorkers int `mapstructure:"max_workers"` // 最大消费者数量,默认 5
}
TaskSummary 任务摘要生成配置
type VMIdle ¶
type VMIdle struct {
SleepSeconds int `mapstructure:"sleep_seconds"` // VM 空闲休眠时间(秒)
RecycleSeconds int `mapstructure:"recycle_seconds"` // VM 空闲回收时间(秒)
RecycleWarnWechatLeadSeconds []int `mapstructure:"recycle_warn_wechat_lead_seconds"` // VM 回收前,微信公众号档每个 tier 的提前预警时长(秒),可配多档;缺省 [7200, 900]
RecycleWarnDefaultLeadSeconds int `mapstructure:"recycle_warn_default_lead_seconds"` // VM 回收前,非微信公众号渠道(钉钉/飞书等)的提前预警时长(秒),<=0 视为禁用该档;缺省 3600
}
type WechatConfig ¶
type WechatConfig struct {
Open WechatOpenConfig `mapstructure:"open"`
MP WechatMPConfig `mapstructure:"mp"`
}
WechatConfig 微信配置(包含开放平台和公众号两部分)
type WechatMPConfig ¶
type WechatMPConfig struct {
AppID string `mapstructure:"app_id"`
AppSecret string `mapstructure:"app_secret"`
Token string `mapstructure:"token"`
EncodingAESKey string `mapstructure:"encoding_aes_key"`
Templates map[string]string `mapstructure:"templates"`
MirrorMode bool `mapstructure:"mirror_mode"`
}
WechatMPConfig 微信公众号配置 - 用于消息推送