task

package
v0.0.0-...-bede5a9 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager allows us to operate on tasks.

func NewManager

func NewManager() *Manager

NewManager creates a new Manager.

func (*Manager) Add

func (m *Manager) Add(content string) (*Task, error)

Add adds a new Task.

func (*Manager) List

func (m *Manager) List() []Task

List returns a list of non-done tasks.

func (*Manager) MarkAsDone

func (m *Manager) MarkAsDone(id uuid.UUID) error

MarkAsDone marks a new Task as done.

func (*Manager) Seed

func (m *Manager) Seed(num uint8) error

Seed adds number num of random tasks.

type Task

type Task struct {
	ID        uuid.UUID
	Content   string
	CreatedAt time.Time
	DoneAt    time.Time
}

Task represents a task to be done by a user.

Jump to

Keyboard shortcuts

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