config

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package config loads workspace-level remindb configuration from .remindb/config.json.

Index

Constants

View Source
const (
	DirName  = ".remindb"
	FileName = "config.json"
	Path     = DirName + "/" + FileName
)

Variables

This section is empty.

Functions

func Resolve

func Resolve[T any](flagChanged bool, flag T, cfg, env *T, def T) T

Resolve picks a value by precedence.

Types

type BudgetsConfig

type BudgetsConfig struct {
	Search     *int `json:"search,omitempty"`
	Fetch      *int `json:"fetch,omitempty"`
	FetchBatch *int `json:"fetch_batch,omitempty"`
	Related    *int `json:"related,omitempty"`
}

type ByteSize

type ByteSize int64

func (*ByteSize) UnmarshalJSON

func (s *ByteSize) UnmarshalJSON(b []byte) error

type CompileConfig

type CompileConfig struct {
	MaxFileSize      *ByteSize `json:"max_file_size,omitempty"`
	MaxParallelism   *int      `json:"max_parallelism,omitempty"`
	WallClockTimeout *Duration `json:"wall_clock_timeout,omitempty"`
}

type Config

type Config struct {
	Budgets     BudgetsConfig     `json:"budgets"`
	Compile     CompileConfig     `json:"compile"`
	Redaction   RedactionConfig   `json:"redaction"`
	Server      ServerConfig      `json:"server"`
	Temperature TemperatureConfig `json:"temperature"`
}

func Load

func Load(workspace string) (Config, error)

Read <workspace>/.remindb/config.json. Missing or empty → zero-value Config.

func (Config) Validate

func (c Config) Validate() error

type Duration

type Duration time.Duration

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

Accept a duration string ("10m", "2h"); JSON has no native duration form.

type LoggingConfig

type LoggingConfig struct {
	Level      *string `json:"level,omitempty"`
	Format     *string `json:"format,omitempty"`
	OutputPath *string `json:"output_path,omitempty"`
}

type RedactionConfig

type RedactionConfig struct {
	DisableBuiltinKinds []string           `json:"disable_builtin_kinds,omitempty"`
	Custom              []RedactionPattern `json:"custom,omitempty"`
}

type RedactionPattern

type RedactionPattern struct {
	Kind    string `json:"kind"`
	Pattern string `json:"pattern"`
}

type ServerConfig

type ServerConfig struct {
	Transport *string       `json:"transport,omitempty"`
	Listen    *string       `json:"listen,omitempty"`
	Logging   LoggingConfig `json:"logging,omitempty"`
}

type TemperatureConfig

type TemperatureConfig struct {
	DecayRate        *float64  `json:"decay_rate,omitempty"`
	AccessBoost      *float64  `json:"access_boost,omitempty"`
	ColdThreshold    *float64  `json:"cold_threshold,omitempty"`
	NotifyThreshold  *float64  `json:"notify_threshold,omitempty"`
	SummarizeRebound *float64  `json:"summarize_rebound,omitempty"`
	TickInterval     *Duration `json:"tick_interval,omitempty"`
	ColdNotifyTTL    *Duration `json:"cold_notify_ttl,omitempty"`
	ColdNotifyLimit  *int      `json:"cold_notify_limit,omitempty"`
}

Jump to

Keyboard shortcuts

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