app

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const WhoIsHiringString string = "Who is hiring?"

Variables

This section is empty.

Functions

func Browse

func Browse()

func FetchAsync

func FetchAsync(fo FetchOptions)

func ReScore

func ReScore(storyID int) (int, error)

Types

type DisplayJob

type DisplayJob struct {
	*db.Job
	DisplayCompany string // what's displayed in the list, e.g. "* [7] McDonald's"
	DisplayText    string // job text formatted for terminal
	Hidden         bool
}

DisplayJob is a db.Job formatted for display

type DisplayStory

type DisplayStory struct {
	*hn.Story
	DisplayTitle string
}

type FetchOptions

type FetchOptions struct {
	Context     context.Context
	Status      chan<- FetchStatusUpdate
	ModeForce   bool
	StoryID     int // fetch latest if 0
	TTLSec      int64
	MustContain string // typically "Who's Hiring"
}

type FetchStatusUpdate

type FetchStatusUpdate struct {
	UpdateType UpdateType
	Message    string
	Value      int // either new job score or number of jobs fetched on completion
	Error      error
}

type UpdateType

type UpdateType = int
const (
	UpdateTypeGeneric  UpdateType = iota
	UpdateTypeNewStory            // value is new story id
	UpdateTypeNonFatalErr
	UpdateTypeFatal
	UpdateTypeBadComment
	UpdateTypeJobFetched
	UpdateTypeDone // value is newJobs + updatedJobs
)

Jump to

Keyboard shortcuts

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