task

package
v0.0.0-...-05d2bf8 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

Set of Task's

func (*Set) AddDescription

func (s *Set) AddDescription(description string)

Add a new Task with given description and a unique Id

func (Set) All

func (s Set) All() iter.Seq[Task]

func (Set) MarshalJSON

func (s Set) MarshalJSON() ([]byte, error)

Returns JSON representation of Set as JSON Array.

Each element is a Task object.

func (*Set) ReadFrom

func (s *Set) ReadFrom(r io.Reader) (int64, error)

Read from given Reader.

Reader should contain json encoded Task Set data. ReadFrom decodes and appends all elements into Set.

func (*Set) UnmarshalJSON

func (s *Set) UnmarshalJSON(data []byte) error

func (*Set) WriteFile

func (s *Set) WriteFile(path string) error

TODO: add tests

func (*Set) WriteTo

func (s *Set) WriteTo(w io.Writer) (int64, error)

Write to given Writer as indented json encoded data.

type Task

type Task struct {
	Id          uint   `json:"id"`
	Description string `json:"description"`

	// One of "done", "todo", "in-progress"
	Status string `json:"status"`
}

func (Task) String

func (t Task) String() string

Get string representation of task

Jump to

Keyboard shortcuts

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