package config // GeminiConfig Gemini 配置 type GeminiConfig struct { OAuth GeminiOAuthConfig `mapstructure:"oauth"` Quota GeminiQuotaConfig `mapstructure:"quota"` } type GeminiOAuthConfig struct { ClientID string `mapstructure:"client_id"` ClientSecret string `mapstructure:"client_secret"` Scopes string `mapstructure:"scopes"` } type GeminiQuotaConfig struct { Tiers map[string]GeminiTierQuotaConfig `mapstructure:"tiers"` Policy string `mapstructure:"policy"` } type GeminiTierQuotaConfig struct { ProRPD *int64 `mapstructure:"pro_rpd" json:"pro_rpd"` FlashRPD *int64 `mapstructure:"flash_rpd" json:"flash_rpd"` CooldownMinutes *int `mapstructure:"cooldown_minutes" json:"cooldown_minutes"` } // UpdateConfig 更新检查配置 type UpdateConfig struct { ProxyURL string `mapstructure:"proxy_url"` // 访问 GitHub 的代理地址 } // IdempotencyConfig 幂等性配置 type IdempotencyConfig struct { ObserveOnly bool `mapstructure:"observe_only"` DefaultTTLSeconds int `mapstructure:"default_ttl_seconds"` SystemOperationTTLSeconds int `mapstructure:"system_operation_ttl_seconds"` ProcessingTimeoutSeconds int `mapstructure:"processing_timeout_seconds"` FailedRetryBackoffSeconds int `mapstructure:"failed_retry_backoff_seconds"` MaxStoredResponseLen int `mapstructure:"max_stored_response_len"` CleanupIntervalSeconds int `mapstructure:"cleanup_interval_seconds"` CleanupBatchSize int `mapstructure:"cleanup_batch_size"` } // LinuxDoConnectConfig LinuxDo 连接配置 type LinuxDoConnectConfig struct { Enabled bool `mapstructure:"enabled"` ClientID string `mapstructure:"client_id"` ClientSecret string `mapstructure:"client_secret"` AuthorizeURL string `mapstructure:"authorize_url"` TokenURL string `mapstructure:"token_url"` UserInfoURL string `mapstructure:"userinfo_url"` Scopes string `mapstructure:"scopes"` RedirectURL string `mapstructure:"redirect_url"` FrontendRedirectURL string `mapstructure:"frontend_redirect_url"` TokenAuthMethod string `mapstructure:"token_auth_method"` UsePKCE bool `mapstructure:"use_pkce"` UserInfoEmailPath string `mapstructure:"userinfo_email_path"` UserInfoIDPath string `mapstructure:"userinfo_id_path"` UserInfoUsernamePath string `mapstructure:"userinfo_username_path"` } // OIDCConnectConfig OIDC 连接配置 type OIDCConnectConfig struct { Enabled bool `mapstructure:"enabled"` ProviderName string `mapstructure:"provider_name"` ClientID string `mapstructure:"client_id"` ClientSecret string `mapstructure:"client_secret"` IssuerURL string `mapstructure:"issuer_url"` DiscoveryURL string `mapstructure:"discovery_url"` AuthorizeURL string `mapstructure:"authorize_url"` TokenURL string `mapstructure:"token_url"` UserInfoURL string `mapstructure:"userinfo_url"` JWKSURL string `mapstructure:"jwks_url"` Scopes string `mapstructure:"scopes"` RedirectURL string `mapstructure:"redirect_url"` FrontendRedirectURL string `mapstructure:"frontend_redirect_url"` TokenAuthMethod string `mapstructure:"token_auth_method"` UsePKCE bool `mapstructure:"use_pkce"` ValidateIDToken bool `mapstructure:"validate_id_token"` AllowedSigningAlgs string `mapstructure:"allowed_signing_algs"` ClockSkewSeconds int `mapstructure:"clock_skew_seconds"` RequireEmailVerified bool `mapstructure:"require_email_verified"` UserInfoEmailPath string `mapstructure:"userinfo_email_path"` UserInfoIDPath string `mapstructure:"userinfo_id_path"` UserInfoUsernamePath string `mapstructure:"userinfo_username_path"` } // TokenRefreshConfig OAuth Token 自动刷新配置 type TokenRefreshConfig struct { Enabled bool `mapstructure:"enabled"` CheckIntervalMinutes int `mapstructure:"check_interval_minutes"` RefreshBeforeExpiryHours float64 `mapstructure:"refresh_before_expiry_hours"` MaxRetries int `mapstructure:"max_retries"` RetryBackoffSeconds int `mapstructure:"retry_backoff_seconds"` }