Documentation
¶
Overview ¶
Package storage persists JobForge state as plain JSON files. We use JSON (not SQLite) because the data is small, hand-editable, easy to inspect, and keeps the project stdlib-only.
Index ¶
- type Store
- func (s *Store) ActiveResume() (resume.Resume, bool, error)
- func (s *Store) AddSource(src source.Source) (source.Source, error)
- func (s *Store) FindJob(idOrPrefix string) (job.Job, error)
- func (s *Store) FindResume(idOrPrefix string) (resume.Resume, error)
- func (s *Store) FindSource(idOrPrefix string) (source.Source, error)
- func (s *Store) ImportResume(srcPath string) (resume.Resume, error)
- func (s *Store) Init() error
- func (s *Store) LoadAppConfig() (config.AppConfig, error)
- func (s *Store) LoadJobs() ([]job.Job, error)
- func (s *Store) LoadProfile() (profile.Profile, error)
- func (s *Store) LoadResumes() ([]resume.Resume, error)
- func (s *Store) LoadSources() ([]source.Source, error)
- func (s *Store) MarkSourceChecked(id string, checkedAt time.Time) error
- func (s *Store) Paths() config.Paths
- func (s *Store) RemoveResume(idOrPrefix string) (resume.Resume, error)
- func (s *Store) RemoveSource(idOrPrefix string) (source.Source, error)
- func (s *Store) SaveAppConfig(c config.AppConfig) error
- func (s *Store) SaveDraft(jobID, body string) (string, error)
- func (s *Store) SaveJobs(jobs []job.Job) error
- func (s *Store) SaveProfile(p profile.Profile) error
- func (s *Store) SaveResumes(rs []resume.Resume) error
- func (s *Store) SaveSources(sources []source.Source) error
- func (s *Store) SetActiveResume(idOrPrefix string) (resume.Resume, error)
- func (s *Store) UpsertJob(j job.Job) ([]job.Job, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the on-disk repository for jobs, profile, and drafts. A single mutex covers all writes; concurrency is not a hot path for a CLI but the guarantee keeps tests honest.
func (*Store) ActiveResume ¶
ActiveResume returns the resume marked active, or false if none is set.
func (*Store) FindResume ¶
FindResume looks up a resume by exact ID or an unambiguous ID prefix.
func (*Store) FindSource ¶
FindSource looks up a source by exact ID or an unambiguous ID prefix.
func (*Store) ImportResume ¶
ImportResume copies srcPath into the resumes directory and records its metadata. If no resume is currently active, the new one becomes active so the writer agent has something to use immediately.
func (*Store) Init ¶
Init creates the data directory and seeds empty files when missing. It is safe to call multiple times.
func (*Store) LoadAppConfig ¶
LoadAppConfig returns the persisted app config or the default if absent.
func (*Store) LoadProfile ¶
LoadProfile returns the saved profile or a fresh skeleton if absent.
func (*Store) LoadResumes ¶
LoadResumes returns all imported resumes sorted by ImportedAt (newest first).
func (*Store) LoadSources ¶
LoadSources returns all configured public job sources sorted newest first.
func (*Store) MarkSourceChecked ¶
MarkSourceChecked records a successful check timestamp.
func (*Store) RemoveResume ¶
RemoveResume deletes a resume's file and removes it from the registry. If the removed resume was active, no other resume is auto-promoted - the user must explicitly set-active to avoid surprising writer behavior.
func (*Store) RemoveSource ¶
RemoveSource removes a configured source from the registry.
func (*Store) SaveAppConfig ¶
SaveAppConfig writes the app config atomically.
func (*Store) SaveDraft ¶
SaveDraft persists a generated draft to drafts/<jobID>.txt and returns the absolute path of the written file.
func (*Store) SaveProfile ¶
SaveProfile writes the profile atomically.
func (*Store) SaveResumes ¶
SaveResumes writes the resume registry atomically.
func (*Store) SaveSources ¶
SaveSources writes the full source list atomically.
func (*Store) SetActiveResume ¶
SetActiveResume marks one resume active and clears the flag on all others.