todo

package
v0.0.0-...-f100638 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

internal/todo.go

Index

Constants

View Source
const (
	ColorDefault = "\x1b[39m"
	ColorRed     = "\x1b[91m"
	ColorGreen   = "\x1b[32m"
	ColorBlue    = "\x1b[94m"
	ColorGray    = "\x1b[90m"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.DB
}

func NewDB

func NewDB(dbPath string) (*DB, error)

func (*DB) AddTodo

func (db *DB) AddTodo(task string) error

func (*DB) CompleteTodo

func (db *DB) CompleteTodo(id int) error

func (*DB) DeleteTodo

func (db *DB) DeleteTodo(id int) error

func (*DB) GetAllTodos

func (db *DB) GetAllTodos() ([]item, error)

func (*DB) GetCompletedTodos

func (db *DB) GetCompletedTodos(since time.Time) ([]item, error)

func (*DB) GetPendingTodos

func (db *DB) GetPendingTodos() ([]item, error)

func (*DB) GetRecentOrPendingTodos

func (db *DB) GetRecentOrPendingTodos(since time.Time) ([]item, error)

func (*DB) InitSchema

func (db *DB) InitSchema() error

Creating the Schema of our DB

type Todos

type Todos struct {
	// contains filtered or unexported fields
}

func NewTodos

func NewTodos(db *DB) *Todos

func (*Todos) Add

func (t *Todos) Add(task string) error

func (*Todos) Complete

func (t *Todos) Complete(id int) error

func (*Todos) CountPending

func (t *Todos) CountPending() int

func (*Todos) Delete

func (t *Todos) Delete(id int) error

func (*Todos) GetStandupTasks

func (t *Todos) GetStandupTasks(currentTime time.Time) ([]string, time.Time)

func (*Todos) GetTasks

func (t *Todos) GetTasks(currentTime time.Time) ([]string, time.Time)

func (*Todos) List

func (t *Todos) List() ([]item, error)

I dont think this is being used right now...

func (*Todos) Print

func (t *Todos) Print() error

Jump to

Keyboard shortcuts

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