model

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node[T any] interface {
	// Children returns an array of pointers to all children of this node.
	Children() []Node[T]

	Value() T
}

type Summary added in v0.4.0

type Summary struct {
	Done  int `json:"done"`
	Total int `json:"total"`
}

func (Summary) String added in v0.4.0

func (s Summary) String() string

type Task

type Task struct {
	State TaskState `json:"state"`
	Text  string    `json:"text"`
	// for now we always skip the field in json
	Depth int `json:"-"`
}

func (Task) String

func (t Task) String() string

type TaskState

type TaskState int64
const (
	Open TaskState = iota
	Cancelled
	Done
)

func (*TaskState) MarshalJSON added in v0.4.0

func (s *TaskState) MarshalJSON() ([]byte, error)

func (TaskState) String added in v0.4.0

func (s TaskState) String() string

func (TaskState) Trigger

func (s TaskState) Trigger() string

type Tree

type Tree[T any] struct {
	// contains filtered or unexported fields
}

func (*Tree[T]) Roots

func (t *Tree[T]) Roots() []Node[T]

Jump to

Keyboard shortcuts

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