db

package
v0.0.0-...-b4a800b Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	ID      uint
	Name    string
	Project string
	Status  string
	Created time.Time
}

Task is a task

func (Task) Description

func (t Task) Description() string

Description returns the description of the task

func (Task) FilterValue

func (t Task) FilterValue() string

FilterValue returns the value to be used for filtering

func (Task) Title

func (t Task) Title() string

Title returns the title of the task

type TaskDB

type TaskDB struct {
	DB      *sql.DB
	DataDir string
}

TaskDB is the database for tasks

func OpenDB

func OpenDB(path string) (*TaskDB, error)

OpenDB opens the database, and creates the table if it doesn't exist

func (*TaskDB) GetTasks

func (t *TaskDB) GetTasks() ([]Task, error)

func (*TaskDB) Insert

func (t *TaskDB) Insert(name, project string) error

Insert inserts a new task into the database

Jump to

Keyboard shortcuts

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