Documentation
¶
Overview ¶
Package backend describes possible database backends for the server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterBackend ¶
func RegisterBackend(b Backend)
RegisterBackend needs to be called to make a backend available for use.
Types ¶
type Backend ¶
type Backend interface {
Name() string
Init() error
Close() error
Save(task msg.Task) error
Config() config.BackendConfig
// RecentTasks gives a summary of the latest activity, limited to the `maxNumber` most recent tasks
RecentTasks(maxNumber int) ([]msg.Summary, error)
// TODO: Split into several meaningful methods?
GetTaskBetween(task string, start time.Time, end time.Time) ([]msg.Summary, error)
GetAllTasksBetween(start time.Time, end time.Time) ([]msg.Summary, error)
}
Backend represents storage of task information, typically a database. TODO: Figure out how to handle malfunctions in remote backends.
Click to show internal directories.
Click to hide internal directories.