config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ButlerConfig

type ButlerConfig struct {
	Enabled          *bool              `json:"enabled"` // nil treated as true (kill switch)
	Capabilities     Capabilities       `json:"capabilities"`
	DocPaths         []string           `json:"doc_paths"`
	Upstream         []UpstreamDep      `json:"upstream"`
	Synthesis        SynthesisConfig    `json:"synthesis"`
	ShadowRepo       string             `json:"shadow_repo"`
	Thresholds       map[string]float64 `json:"thresholds"`
	MaxDailyLLMCalls int                `json:"max_daily_llm_calls"`
}

func DefaultConfig

func DefaultConfig() ButlerConfig

func Parse

func Parse(data []byte) (ButlerConfig, error)

func (ButlerConfig) IsEnabled

func (c ButlerConfig) IsEnabled() bool

IsEnabled returns false only when Enabled is explicitly set to false.

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache provides a TTL-based cache for butler config.

func NewCache

func NewCache(ttl time.Duration, fetch FetchFunc) *Cache

NewCache creates a new config cache with the given TTL and fetch function.

func (*Cache) Get

func (c *Cache) Get() (ButlerConfig, error)

Get returns the cached config, fetching it if the cache is stale or empty.

func (*Cache) Invalidate

func (c *Cache) Invalidate()

Invalidate forces the next Get() call to re-fetch.

type Capabilities

type Capabilities struct {
	Triage         bool `json:"triage"`
	Research       bool `json:"research"`
	Synthesis      bool `json:"synthesis"`
	AutoIngest     bool `json:"auto_ingest"`
	CodeNavigation bool `json:"code_navigation"`
}

type FetchFunc

type FetchFunc func() ([]byte, error)

FetchFunc fetches the raw config file content. Returns nil, nil if the file doesn't exist.

type SynthesisConfig

type SynthesisConfig struct {
	Frequency string `json:"frequency"`
	Day       string `json:"day"`
}

type UpstreamDep

type UpstreamDep struct {
	Repo    string `json:"repo"`
	DocType string `json:"doc_type"`
	Track   string `json:"track"`
}

Jump to

Keyboard shortcuts

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