seen

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(job models.Job) (string, bool)

Key builds a normalized comparison key for a job. Primary key is title+company; URL is used as a fallback when needed.

func Normalize

func Normalize(value string) string

Normalize applies the v1 key normalization.

func ReadJobs

func ReadJobs(path string) ([]models.Job, error)

ReadJobs reads a JSON array of jobs from path.

func ReadJobsAllowMissing

func ReadJobsAllowMissing(path string) ([]models.Job, error)

ReadJobsAllowMissing reads jobs and treats missing files as empty history.

func WriteJobs

func WriteJobs(path string, jobs []models.Job) error

WriteJobs writes jobs as pretty JSON.

Types

type DiffStats

type DiffStats struct {
	TotalNew    int
	TotalSeen   int
	InvalidNew  int
	InvalidSeen int
	Unseen      int
}

DiffStats captures stats for A-B unseen filtering.

func Diff

func Diff(newJobs []models.Job, seenJobs []models.Job) ([]models.Job, DiffStats)

Diff returns unseen jobs from newJobs using existing seenJobs keys.

func (DiffStats) InvalidSkipped

func (s DiffStats) InvalidSkipped() int

InvalidSkipped returns the total invalid records skipped during comparison.

type MergeStats

type MergeStats struct {
	TotalSeen    int
	TotalInput   int
	InvalidSeen  int
	InvalidInput int
	Added        int
	TotalOut     int
}

MergeStats captures stats for seen history updates.

func Merge

func Merge(existingSeen []models.Job, inputJobs []models.Job) ([]models.Job, MergeStats)

Merge appends unique new jobs into the seen history. Existing seen entries win collisions.

func (MergeStats) InvalidSkipped

func (s MergeStats) InvalidSkipped() int

InvalidSkipped returns the total invalid records skipped during merge.

Jump to

Keyboard shortcuts

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