Documentation
¶
Index ¶
- 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 InitTeam
- type LLM
- type Loki
- type NLS
- type Notify
- type PublicHost
- type SMTP
- type Session
- type Task
- type TaskFlow
- type TaskSummary
- type VMIdle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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"`
PublicHost PublicHost `mapstructure:"public_host"`
Task Task `mapstructure:"task"`
TaskSummary TaskSummary `mapstructure:"task_summary"`
Loki Loki `mapstructure:"loki"`
LLM LLM `mapstructure:"llm"`
Notify Notify `mapstructure:"notify"`
VMIdle VMIdle `mapstructure:"vm_idle"`
// 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"`
InitTeam InitTeam `mapstructure:"init_team"`
// 语音识别配置(阿里云 NLS)
NLS NLS `mapstructure:"nls"`
}
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 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 PublicHost ¶
type PublicHost struct {
CountLimit int `mapstructure:"count_limit"` // 每用户公共主机 VM 数量限制,0 表示不限制
TTLLimit int64 `mapstructure:"ttl_limit"` // 公共主机 VM 续期上限(秒),0 表示不限制
}
PublicHost 公共主机配置(可选,内部项目通过 WithPublicHost 注入时生效)
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
MaxWorkers int `mapstructure:"max_workers"` // 最大消费者数量,默认 5
}
TaskSummary 任务摘要生成配置