store

package
v0.7.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("application not found")
)

Functions

This section is empty.

Types

type Store

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

Store manages job applications in a JSON file

func New

func New(path string) (*Store, error)

New creates a new Store with the given file path

func (*Store) Add

func (s *Store) Add(app model.Application) (model.Application, error)

Add creates a new application and returns it

func (*Store) CountByStatus

func (s *Store) CountByStatus() map[string]int

CountByStatus returns a map of status to count

func (*Store) Delete

func (s *Store) Delete(id string) error

Delete removes an application by ID

func (*Store) FilterByStatus

func (s *Store) FilterByStatus(status string) []model.Application

FilterByStatus returns applications with the given status

func (*Store) GetByID

func (s *Store) GetByID(id string) (model.Application, error)

GetByID returns a single application by ID

func (*Store) List

func (s *Store) List() []model.Application

List returns all applications, sorted by status priority (later stages first), then by date (newest first)

func (*Store) Search

func (s *Store) Search(query string) []model.Application

Search returns applications matching the query in company or position

func (*Store) Total

func (s *Store) Total() int

Total returns the total number of applications

func (*Store) Update

func (s *Store) Update(app model.Application) error

Update modifies an existing application

func (*Store) UpdateStatus

func (s *Store) UpdateStatus(id string, status string) error

UpdateStatus is a convenience method to change just the status

Jump to

Keyboard shortcuts

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