db

package
v0.0.0-...-d2b517e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteTask

func DeleteTask(id int) error

DeleteTask marks a task as deleted

func DoTask

func DoTask(id int) error

DoTask marks a task as complete

func Init

func Init(dbPath string) error

Init initializes database

Types

type Task

type Task struct {
	ID          int `storm:"id,increment"`
	Value       string
	Completed   bool
	Deleted     bool
	CreatedAt   time.Time
	CompletedAt time.Time
}

Task rep

func CreateTask

func CreateTask(value string) (Task, error)

CreateTask adds task to the DB

func FetchCompletedTasks

func FetchCompletedTasks(timeDelta time.Duration) ([]Task, error)

FetchCompletedTasks returns a list of all completed tasks

func FetchTasks

func FetchTasks() ([]Task, error)

FetchTasks retrieves all tasks

Jump to

Keyboard shortcuts

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