todo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package todo

Copyright © 2026 mtnr_dev <timo@mtnr.cloud>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Todo

type Todo struct {
	ID          int       `json:"id"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Completed   bool      `json:"completed"`
	CreatedAt   time.Time `json:"created_at"`
}

type TodoList

type TodoList struct {
	Todos  []Todo `json:"todos"`
	NextID int    `json:"next_id"`
}

func NewTodoList

func NewTodoList() *TodoList

func (*TodoList) Add

func (tl *TodoList) Add(title string) *Todo

func (*TodoList) Complete

func (tl *TodoList) Complete(id int) bool

Complete marks a todo as completed

func (*TodoList) Delete

func (tl *TodoList) Delete(id int) bool

Delete removes a todo from the list

func (*TodoList) GetActive

func (tl *TodoList) GetActive() []Todo

GetActive returns all uncompleted todos

func (*TodoList) GetAll

func (tl *TodoList) GetAll() []Todo

GetAll returns all todos

func (*TodoList) GetByID

func (tl *TodoList) GetByID(id int) *Todo

GetByID retrieves a todo by its ID

func (*TodoList) GetCompleted

func (tl *TodoList) GetCompleted() []Todo

GetCompleted returns all completed todos

Jump to

Keyboard shortcuts

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