config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigEnv = "GITCRAWL_CONFIG"
	DefaultTokenEnv  = "GITHUB_TOKEN"
	DefaultOpenAIEnv = "OPENAI_API_KEY"
)

Variables

This section is empty.

Functions

func EnsureRuntimeDirs

func EnsureRuntimeDirs(cfg Config) error

func ResolvePath

func ResolvePath(flagPath string) string

func Save

func Save(path string, cfg Config) error

Types

type Config

type Config struct {
	Version        int          `toml:"version"`
	DBPath         string       `toml:"db_path"`
	CacheDir       string       `toml:"cache_dir"`
	VectorDir      string       `toml:"vector_dir"`
	LogDir         string       `toml:"log_dir"`
	GitHub         GitHubConfig `toml:"github"`
	OpenAI         OpenAIConfig `toml:"openai"`
	EmbeddingBasis string       `toml:"embedding_basis"`
	TUI            TUIConfig    `toml:"tui"`
}

func Default

func Default() Config

func Load

func Load(path string) (Config, error)

func (*Config) Normalize

func (c *Config) Normalize() error

type GitHubConfig

type GitHubConfig struct {
	TokenEnv string `toml:"token_env"`
}

type OpenAIConfig

type OpenAIConfig struct {
	APIKeyEnv       string `toml:"api_key_env"`
	SummaryModel    string `toml:"summary_model"`
	EmbedModel      string `toml:"embed_model"`
	EmbedDimensions int    `toml:"embed_dimensions"`
	BatchSize       int    `toml:"batch_size"`
	Concurrency     int    `toml:"concurrency"`
}

type TUIConfig

type TUIConfig struct {
	DefaultSort string `toml:"default_sort"`
}

type TokenResolution

type TokenResolution struct {
	Value  string
	Source string
}

func ResolveGitHubToken

func ResolveGitHubToken(cfg Config) TokenResolution

func ResolveOpenAIKey

func ResolveOpenAIKey(cfg Config) TokenResolution

Jump to

Keyboard shortcuts

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