Documentation
¶
Index ¶
- Constants
- type Config
- func (c Config) GetLogMaxSize() int64
- func (c Config) GetMetricsMaxSize() int64
- func (c Config) GetTimeoutMS() int
- func (c Config) IsLogDisabled() bool
- func (c Config) IsMetricsDisabled() bool
- func (c Config) ResolveLogPath() string
- func (c Config) ResolveMetricsPath() string
- func (c Config) Validate() error
- type ProviderConfig
Constants ¶
View Source
const ( DefaultTimeoutMS = 20_000 DefaultModel = string(anthropic.ModelClaudeHaiku4_5) DefaultProvider = "anthropic" DefaultLogMaxSize = 5 * 1024 * 1024 // 5MB DefaultMetricsMaxSize = 2 * 1024 * 1024 // 2MB BaseConfigName = "ccgate.jsonnet" LocalConfigName = "ccgate.local.jsonnet" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Provider ProviderConfig `json:"provider"`
LogPath string `json:"log_path"`
LogDisabled *bool `json:"log_disabled"`
LogMaxSize *int64 `json:"log_max_size"`
MetricsPath string `json:"metrics_path"`
MetricsDisabled *bool `json:"metrics_disabled"`
MetricsMaxSize *int64 `json:"metrics_max_size"`
Allow []string `json:"allow"`
Deny []string `json:"deny"`
Environment []string `json:"environment"`
}
func (Config) GetLogMaxSize ¶ added in v0.3.0
GetLogMaxSize returns the log max size, defaulting to DefaultLogMaxSize. 0 means no rotation.
func (Config) GetMetricsMaxSize ¶ added in v0.3.0
GetMetricsMaxSize returns the metrics max size, defaulting to DefaultMetricsMaxSize. 0 means no rotation.
func (Config) GetTimeoutMS ¶ added in v0.3.0
GetTimeoutMS returns the provider timeout in milliseconds. nil defaults to DefaultTimeoutMS.
func (Config) IsLogDisabled ¶ added in v0.3.0
IsLogDisabled returns whether logging is disabled.
func (Config) IsMetricsDisabled ¶ added in v0.3.0
IsMetricsDisabled returns whether metrics collection is disabled.
func (Config) ResolveLogPath ¶
ResolveLogPath returns the resolved log file path.
func (Config) ResolveMetricsPath ¶ added in v0.3.0
ResolveMetricsPath returns the resolved metrics file path.
type ProviderConfig ¶
type ProviderConfig struct {
Name string `json:"name"`
Model string `json:"model"`
TimeoutMS *int `json:"timeout_ms"`
}
func (ProviderConfig) GetTimeoutMS ¶ added in v0.3.0
func (p ProviderConfig) GetTimeoutMS() int
GetTimeoutMS returns the timeout in milliseconds. nil defaults to DefaultTimeoutMS; 0 means no timeout.
Click to show internal directories.
Click to hide internal directories.