Documentation
¶
Overview ¶
Package jobber orchestrates scheduled scraping of job offers from external sources based on user-defined search queries. It manages query lifecycle (creation, scheduling, expiration), persists results to a database, and automatically prunes stale queries after 7 days of inactivity. Each query runs on an hourly cron schedule, deduplicates offers, and maintains query-offer associations for efficient retrieval.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTimedOut = errors.New("operation timed out")
Functions ¶
This section is empty.
Types ¶
type Jobber ¶
type Jobber struct {
// contains filtered or unexported fields
}
func (*Jobber) CreateQuery ¶
CreateQuery creates a new query, schedules it for future runs and also runs it immediately. While running it immediately it will block the caller until the job finishes or it times out.
func (*Jobber) ListOffers ¶
func (j *Jobber) ListOffers(ctx context.Context, gqp *db.GetQueryParams) ([]*db.Offer, *pgtype.Timestamptz, error)
ListOffers return the list of offers for a given query's keywords and location and the last time the query was updated to calculate the Cache-Control header. Returns sql.ErrNoRows for non-existent query.