config

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeoutMS  = 20_000
	DefaultModel      = string(anthropic.ModelClaudeHaiku4_5)
	DefaultProvider   = "anthropic"
	DefaultLogPath    = "~/.claude/logs/ccgate.log"
	DefaultLogMaxSize = 5 * 1024 * 1024 // 5MB
	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"`
	Allow       []string       `json:"allow"`
	Deny        []string       `json:"deny"`
	Environment []string       `json:"environment"`
}

func Default

func Default() Config

func Load

func Load(cwd string) (Config, error)

Load reads the base config from ~/.claude/ and merges project-local overrides.

func (Config) ResolveLogPath

func (c Config) ResolveLogPath() string

ResolveLogPath expands ~ in LogPath and returns the absolute path.

func (Config) Validate

func (c Config) Validate() error

Validate checks Config invariants. Returns an error describing all violations.

type ProviderConfig

type ProviderConfig struct {
	Name      string `json:"name"`
	Model     string `json:"model"`
	TimeoutMS int    `json:"timeout_ms"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL