Documentation
¶
Overview ¶
Package config handles configuration loading, saving, and credential management.
Index ¶
- Constants
- Variables
- func ClearConfig() error
- func DefaultDBPath() string
- func GetGeminiAPIKey() (string, error)
- func GetGitHubPAT() (string, error)
- func IsConfigured() bool
- func SaveConfig(cfg *Config, githubPAT, geminiAPIKey string) error
- func SetKeyringBackend(kb KeyringBackend)
- type Config
- type KeyringBackend
Constants ¶
const ( // KeyringService is the service name used for keyring storage. KeyringService = "repog" // KeyringGitHubPAT is the keyring key for the GitHub PAT. KeyringGitHubPAT = "github_pat" // KeyringGeminiAPIKey is the keyring key for the Gemini API key. KeyringGeminiAPIKey = "gemini_api_key" // ConfigVersion is the current config file version. ConfigVersion = 2 )
Variables ¶
var ErrNotConfigured = errors.New("repog is not configured — run `repog init` first")
ErrNotConfigured is returned when repog has not been initialised.
Functions ¶
func ClearConfig ¶
func ClearConfig() error
ClearConfig removes the config file and deletes keyring entries.
func GetGeminiAPIKey ¶
GetGeminiAPIKey retrieves the Gemini API key from the keyring.
func GetGitHubPAT ¶
GetGitHubPAT retrieves the GitHub PAT from the keyring.
func IsConfigured ¶
func IsConfigured() bool
IsConfigured returns true if config file exists and both secrets are present in the keyring.
func SaveConfig ¶
SaveConfig writes config to disk and stores secrets in the keyring.
func SetKeyringBackend ¶
func SetKeyringBackend(kb KeyringBackend)
SetKeyringBackend sets the keyring backend (for testing).
Types ¶
type Config ¶
Config represents the on-disk configuration.
func LoadConfig ¶
LoadConfig reads config from disk. Returns ErrNotConfigured if config file does not exist or either secret is missing from the keyring.