postgres

package
Version: v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 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) 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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL