config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigEnv      = "DEVPULSE_CONFIG"
	KeyringService = "devpulse"
)

Variables

This section is empty.

Functions

func GetAPIKey

func GetAPIKey(provider string) (string, error)

func HasAPIKey

func HasAPIKey(provider string) (bool, error)

HasAPIKey reports whether an API key is available for the provider, matching the precedence of GetAPIKey: the *_API_KEY environment variable first, then the OS keychain.

func NormalizeRepoPath added in v0.3.0

func NormalizeRepoPath(path string) (string, error)

NormalizeRepoPath returns a cleaned absolute path for a repository registration. It deliberately does not resolve symlinks: the path saved in config should remain the path the user selected while still being stable for relative inputs and duplicate-path checks.

func PromptAndStoreAPIKey

func PromptAndStoreAPIKey(provider string, stdin *os.File, stderr io.Writer) error

func WorkspaceBaseDir

func WorkspaceBaseDir() (string, error)

WorkspaceBaseDir returns the root DevPulse data directory. When the DEVPULSE_CONFIG env var points at a config file, the workspace follows it so notes, goals, cache, and logs live alongside the config; otherwise it is ~/.devpulse.

Types

type Config

type Config struct {
	RegisteredRepos    map[string]string `toml:"registered_repos"`
	ModelFast          string            `toml:"model_fast"`
	ModelDeep          string            `toml:"model_deep"`
	CacheDurationHours int               `toml:"cache_duration_hours"`
	FuzzyThreshold     int               `toml:"fuzzy_threshold"`
}

type Manager

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

func Load

func Load() (*Manager, error)

func (*Manager) BaseDir

func (m *Manager) BaseDir() string

func (*Manager) CacheDurationHours

func (m *Manager) CacheDurationHours() int

CacheDurationHours returns the configured cache lifetime in hours.

func (*Manager) ConfigPath

func (m *Manager) ConfigPath() string

func (*Manager) Get

func (m *Manager) Get(key string) (string, error)

func (*Manager) InitializeGoalsFile

func (m *Manager) InitializeGoalsFile() (created bool, path string, hasAPIKey bool, err error)

func (*Manager) ListRepositories

func (m *Manager) ListRepositories() []models.RegisteredRepo

func (*Manager) LogsDir

func (m *Manager) LogsDir() string

func (*Manager) RegisterRepository

func (m *Manager) RegisterRepository(path string) (models.RegisteredRepo, error)

func (*Manager) RepositoryPath

func (m *Manager) RepositoryPath(name string) (string, bool)

RepositoryPath returns the absolute path for a registered repository name. Returns false if the name is not registered.

func (*Manager) Save

func (m *Manager) Save() error

func (*Manager) Set

func (m *Manager) Set(key string, value string) error

func (*Manager) UnregisterRepository

func (m *Manager) UnregisterRepository(name string) error

Jump to

Keyboard shortcuts

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