postgres

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TableName = "jobs"
)

Functions

This section is empty.

Types

type DB

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

func New

func New(dsn string) *DB

New instantiates a new DB.

func (DB) Close

func (d DB) Close() error

Close closes the connection to Postgres.

func (DB) Delete

func (d DB) Delete(id string) error

Delete deletes a persisted Job.

func (DB) DeleteDuplicateJobs added in v0.8.8

func (d DB) DeleteDuplicateJobs() error

Delete jobs duplicate

func (DB) DeleteIsDone added in v0.8.8

func (d DB) DeleteIsDone() error

Delete jobs state is done

func (DB) Get

func (d DB) Get(id string) (*job.Job, error)

Get returns a persisted Job.

func (DB) GetAll

func (d DB) GetAll() ([]*job.Job, error)

GetAll returns all persisted Jobs.

func (DB) Save

func (d DB) Save(j *job.Job) error

Save persists a Job.

Jump to

Keyboard shortcuts

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