Documentation
¶
Overview ¶
Package config resolves and manages JobForge's on-disk locations. We use os.UserConfigDir so paths follow OS conventions (%APPDATA% on Windows).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
LLM LLMSettings `json:"llm"`
Google GoogleSettings `json:"google,omitempty"`
IMAP IMAPSettings `json:"imap,omitempty"`
}
AppConfig is the user-editable settings file (config.json). It is loaded once per CLI invocation. Keep it small and obvious - anything that needs to be a per-run flag belongs on the command line, not here.
func DefaultAppConfig ¶
func DefaultAppConfig() AppConfig
DefaultAppConfig returns the config we seed for a brand-new install.
type GoogleSettings ¶
type GoogleSettings struct {
ClientID string `json:"client_id,omitempty"`
ClientSecret string `json:"client_secret,omitempty"`
// CalendarID is the target calendar for new events. Defaults to
// "primary" if blank.
CalendarID string `json:"calendar_id,omitempty"`
}
GoogleSettings holds the OAuth client identifiers the user copies out of their Google Cloud project. The CLIENT SECRET in a desktop OAuth app is *not* actually secret in the cryptographic sense (Google's own docs acknowledge this) — it lives in the source of every distributed installer. We store it in config.json as a convenience.
The sensitive value is the user's refresh token, persisted separately at Paths.GoogleTokenFile with restrictive permissions.
type IMAPSettings ¶
type IMAPSettings struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"` // defaults to 993 (IMAPS) when zero
Username string `json:"username,omitempty"`
// UseTLS controls whether we use IMAPS (TLS-on-connect) vs STARTTLS.
// Default true. Plain-text IMAP is intentionally not supported —
// the user's mailbox is too sensitive to send credentials in clear.
UseTLS bool `json:"use_tls"`
// Folder defaults to "INBOX" when blank. Useful to set to a
// JobForge-specific label (e.g. "JobForge/Applications") if the
// user pre-filters mail server-side.
Folder string `json:"folder,omitempty"`
}
IMAPSettings configures the inbox monitor (jobforge inbox poll). The password lives at Paths.IMAPPasswordFile with restrictive perms, not in this struct, so config.json stays safe to share.
type LLMSettings ¶
type LLMSettings struct {
Provider string `json:"provider"`
BaseURL string `json:"base_url,omitempty"`
APIKey string `json:"api_key,omitempty"`
Model string `json:"model,omitempty"`
}
LLMSettings describes which LLM provider the agents should call.
Supported providers:
- "noop": default; returns an empty response so the writer falls back to its deterministic template. Requires no other fields.
- "openai-compatible": any chat-completions endpoint that mirrors OpenAI's shape (OpenAI itself, Together, vLLM, Ollama's OpenAI shim, etc.). Requires BaseURL and Model; APIKey is optional for unauthenticated local deployments.
type Paths ¶
type Paths struct {
Root string
ConfigFile string
ProfileFile string
JobsFile string
SourcesFile string
ResumesFile string
DraftsDir string
ResumesDir string
GoogleTokenFile string
IMAPPasswordFile string
InboxStateFile string
}
Paths groups every file JobForge owns. Holding them on a single struct makes it cheap to override roots in tests with a temp directory.
func (Paths) EnsureDirs ¶
EnsureDirs creates the JobForge data directory tree if missing.