backend

package
v0.0.0-...-8cfe5f7 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2020 License: GPL-3.0 Imports: 3 Imported by: 3

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.

func From

func From(conf *config.Opts) Backend

From determines and sets up a backend based on configuration options.

Directories

Path Synopsis
SQLite3 backend for the tilo server.
SQLite3 backend for the tilo server.

Jump to

Keyboard shortcuts

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