database

package
v0.0.0-...-36fcf6a Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("document not found")
)

database error constants

Functions

This section is empty.

Types

type JobDB

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

JobDB talks to a couchDB server and handles Job instances

func NewJobDB

func NewJobDB(db *couchdb.Database) *JobDB

NewJobDB returns a new JobDB instance

func (*JobDB) Delete

func (db *JobDB) Delete(job *api.Job) error

Delete removes the job from the database

func (*JobDB) Get

func (db *JobDB) Get(id string) (*api.Job, error)

Get fetches a job from database, identified by given UUID

func (*JobDB) GetList

func (db *JobDB) GetList(page, perPage int) ([]*api.Job, error)

GetList returns a paginated list of jobs

func (*JobDB) GetListByStatus

func (db *JobDB) GetListByStatus(status string, page, perPage int) ([]*api.Job, error)

GetListByStatus returns a paginated list of jobs with the given status

func (*JobDB) Save

func (db *JobDB) Save(job *api.Job) error

Save writes the job to DB

Jump to

Keyboard shortcuts

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