storage

package
v0.0.0-...-1aaec36 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresStorage

func NewPostgresStorage(config PostgresDBConfig) (postgres *postgresStorage, err error)

creates new instance of postgres DB

Types

type PostgresDBConfig

type PostgresDBConfig struct {
	DbURL string
}

type TaskAttributes

type TaskAttributes struct {
	Hash        string
	Name        string
	LastRun     string
	NextRun     string
	Duration    string
	IsRecurring string
	Params      []string
}

TaskAttributes is a struct which is used to transfer data from/to stores. All task data are converted from/to string to prevent the store from worrying about details of converting data to the proper formats.

type TaskStore

type TaskStore interface {
	Add(TaskAttributes) error
	Update(TaskAttributes) error
	Fetch() ([]TaskAttributes, error)
	Remove(TaskAttributes) error
	Close() error
}

TaskStore is the interface to implement when adding custom task storage.

Jump to

Keyboard shortcuts

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