model

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDidaTime

func ParseDidaTime(value string) (time.Time, bool)

Types

type Column

type Column struct {
	ID        string `json:"id"`
	ProjectID string `json:"projectId,omitempty"`
	Name      string `json:"name,omitempty"`
	TaskCount int    `json:"taskCount"`
}

func InferColumns

func InferColumns(projectID string, tasks []Task) []Column

type Project

type Project struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Closed bool   `json:"closed,omitempty"`
	Color  string `json:"color,omitempty"`
	Raw    any    `json:"raw,omitempty"`
}

func NormalizeProjects

func NormalizeProjects(items []map[string]any) []Project

type SyncView

type SyncView struct {
	InboxID       string           `json:"inboxId,omitempty"`
	Projects      []Project        `json:"projects"`
	Tasks         []Task           `json:"tasks"`
	ProjectGroups []map[string]any `json:"projectGroups,omitempty"`
	Tags          []map[string]any `json:"tags,omitempty"`
	Filters       []map[string]any `json:"filters,omitempty"`
	Counts        map[string]int   `json:"counts"`
}

func BuildSyncView

func BuildSyncView(inboxID string, rawProjects []map[string]any, rawTasks []map[string]any, rawProjectGroups []map[string]any, rawTags []map[string]any, rawFilters []map[string]any, now time.Time) SyncView

type Task

type Task struct {
	ID            string           `json:"id"`
	ProjectID     string           `json:"projectId"`
	ProjectName   string           `json:"projectName,omitempty"`
	ParentID      string           `json:"parentId,omitempty"`
	Title         string           `json:"title"`
	Content       string           `json:"content,omitempty"`
	Desc          string           `json:"desc,omitempty"`
	AllDay        bool             `json:"allDay,omitempty"`
	DueDate       string           `json:"dueDate,omitempty"`
	DueUnix       int64            `json:"dueUnix,omitempty"`
	StartDate     string           `json:"startDate,omitempty"`
	StartUnix     int64            `json:"startUnix,omitempty"`
	CompletedAt   string           `json:"completedTime,omitempty"`
	CompletedUnix int64            `json:"completedUnix,omitempty"`
	Priority      int              `json:"priority"`
	Status        int              `json:"status"`
	Deleted       int              `json:"deleted"`
	ColumnID      string           `json:"columnId,omitempty"`
	Tags          []string         `json:"tags,omitempty"`
	Items         []map[string]any `json:"items,omitempty"`
	Reminders     []any            `json:"reminders,omitempty"`
	Repeat        string           `json:"repeat,omitempty"`
	RepeatFrom    string           `json:"repeatFrom,omitempty"`
	RepeatFlag    string           `json:"repeatFlag,omitempty"`
	IsFloating    bool             `json:"isFloating,omitempty"`
	Overdue       bool             `json:"overdue,omitempty"`
	Raw           any              `json:"raw,omitempty"`
}

func ActiveTasks

func ActiveTasks(tasks []Task) []Task

func FindTask

func FindTask(tasks []Task, id string) (Task, bool)

func NormalizeTasks

func NormalizeTasks(items []map[string]any, projectNames map[string]string, now time.Time) []Task

func ProjectTasks

func ProjectTasks(tasks []Task, projectID string) []Task

func SearchTasks

func SearchTasks(tasks []Task, query string) []Task

func TodayTasks

func TodayTasks(tasks []Task, now time.Time) []Task

func UpcomingTasks

func UpcomingTasks(tasks []Task, now time.Time, days int) []Task

Jump to

Keyboard shortcuts

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