config

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 10 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"`
	Rescan      RescanConfig      `json:"rescan"`
	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 Parse added in v0.3.4

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

Decode and validate raw config.json bytes. 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"`
	BufferSize   *int               `json:"buffer_size,omitempty"`
	SessionFiles SessionFilesConfig `json:"session_files"`
}

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 RescanConfig added in v0.3.4

type RescanConfig struct {
	Enabled  *bool     `json:"enabled,omitempty"`
	Interval *Duration `json:"interval,omitempty"`
	Settle   *Duration `json:"settle,omitempty"`
}

type RescanFilesConfig added in v0.3.5

type RescanFilesConfig struct {
	Enabled     *bool     `json:"enabled,omitempty"`
	MaxFileSize *ByteSize `json:"max_file_size,omitempty"`
}

type ResourcesConfig added in v0.3.4

type ResourcesConfig struct {
	Debounce  *Duration            `json:"debounce,omitempty"`
	Overrides map[string]*Duration `json:"overrides,omitempty"`
}

type ServerConfig

type ServerConfig struct {
	Transport   *string           `json:"transport,omitempty"`
	Listen      *string           `json:"listen,omitempty"`
	Logging     LoggingConfig     `json:"logging"`
	Resources   ResourcesConfig   `json:"resources"`
	Sessions    SessionsConfig    `json:"sessions"`
	RescanFiles RescanFilesConfig `json:"rescan_files"`
}

type SessionFilesConfig added in v0.3.5

type SessionFilesConfig struct {
	Enabled     *bool     `json:"enabled,omitempty"`
	MaxFileSize *ByteSize `json:"max_file_size,omitempty"`
}

type SessionsConfig added in v0.3.5

type SessionsConfig struct {
	FlushInterval *Duration `json:"flush_interval,omitempty"`
}

type TemperatureConfig

type TemperatureConfig struct {
	Enabled          *bool     `json:"enabled,omitempty"`
	DecayRate        *float64  `json:"decay_rate,omitempty"`
	AccessBoost      *float64  `json:"access_boost,omitempty"`
	HotThreshold     *float64  `json:"hot_threshold,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