db

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Status

type Status struct {
	Plan          string     `json:"plan"`
	NextRun       time.Time  `json:"next_run"`
	LastRun       *time.Time `json:"last_run,omitempty"`
	LastRunStatus string     `json:"last_run_status,omitempty"`
	LastRunLog    string     `json:"last_run_log,omitempty"`
}

type StatusStore

type StatusStore struct {
	*Store
	// contains filtered or unexported fields
}

func NewStatusStore

func NewStatusStore(store *Store) (*StatusStore, error)

NewStatusStore creates bucket if not found

func (*StatusStore) GetAll

func (db *StatusStore) GetAll() ([]*Status, error)

GetAll loads all jobs stats from db

func (*StatusStore) Put

func (db *StatusStore) Put(status *Status) error

Put upserts job status

func (*StatusStore) Sync

func (db *StatusStore) Sync(stats []*Status) error

Sync plans found on disk with db

type Store

type Store struct {
	*bolt.DB
}

func Open

func Open(path string) (*Store, error)

Open creates or opens a bolt db at the specified path.

func (*Store) DeleteBucket

func (db *Store) DeleteBucket(name []byte) error

func (*Store) NewBucket

func (db *Store) NewBucket(name []byte) error

Jump to

Keyboard shortcuts

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