taskpoet

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: BSD-2-Clause Imports: 32 Imported by: 0

Documentation

Overview

Package taskpoet is the main worker library

Index

Constants

View Source
const (
	// XS is extra small
	XS int = 1
	// SM is small
	SM int = 3
	// MD is medium
	MD int = 5
	// LG is large
	LG int = 10
)
View Source
const DefaultPluginID string = "builtin"

DefaultPluginID is just the string used as the built in plugin default

Variables

View Source
var TaskPlugins = map[string]Creator{}

TaskPlugins isi the creator map

Functions

func APIClient added in v0.0.2

func APIClient(client *Poet) gin.HandlerFunc

APIClient is an API Client

func AddPlugin added in v0.0.2

func AddPlugin(name string, creator Creator)

AddPlugin adds a new plugin

func CheckUniqueStringSlice added in v0.0.2

func CheckUniqueStringSlice(target []string) bool

CheckUniqueStringSlice checks if this is a unique thing

func EffortImpactText added in v0.0.2

func EffortImpactText(code int) string

EffortImpactText returns text from the code

func FilterHidden added in v0.0.10

func FilterHidden(p *FilterParams, task Task) bool

FilterHidden removes items that are still hidden

func FilterRegex added in v0.0.10

func FilterRegex(p *FilterParams, task Task) bool

FilterRegex removes items not matching a given regex

func MustParseDuration added in v0.1.0

func MustParseDuration(s string) time.Duration

MustParseDuration parses a duration or panics

func NewRouter added in v0.0.2

func NewRouter(rc *RouterConfig) *gin.Engine

NewRouter returns a new http router

func ParseDuration

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w".

func WithPresent added in v0.2.2

func WithPresent(t *time.Time) func(*Calendar)

WithPresent sets the present time to an arbitrary datetime

func WithStatusChannel added in v0.1.0

func WithStatusChannel(s chan ProgressStatus) func(*ProgressModel)

WithStatusChannel sets the channel on a new object

func WithWeights added in v0.3.1

func WithWeights(w weightMap) func(*Curator)

WithWeights sets the weights in a curator at build time

Types

type APITaskResponse added in v0.0.2

type APITaskResponse struct {
	Pagination Pagination `json:"pagination"`
	Data       Tasks      `json:"data"`
}

APITaskResponse is the task response

type ByCompleted added in v0.1.0

type ByCompleted Tasks

ByCompleted is the by completed date sorter

func (ByCompleted) Len added in v0.1.0

func (a ByCompleted) Len() int

func (ByCompleted) Less added in v0.1.0

func (a ByCompleted) Less(i, j int) bool

func (ByCompleted) Swap added in v0.1.0

func (a ByCompleted) Swap(i, j int)

type ByDue added in v0.1.0

type ByDue Tasks

ByDue is the by due date sorter

func (ByDue) Len added in v0.1.0

func (a ByDue) Len() int

func (ByDue) Less added in v0.1.0

func (a ByDue) Less(i, j int) bool

func (ByDue) Swap added in v0.1.0

func (a ByDue) Swap(i, j int)

type ByUrgency added in v0.3.1

type ByUrgency Tasks

ByUrgency sorts using the Urgency field

func (ByUrgency) Len added in v0.3.1

func (a ByUrgency) Len() int

func (ByUrgency) Less added in v0.3.1

func (a ByUrgency) Less(i, j int) bool

func (ByUrgency) Swap added in v0.3.1

func (a ByUrgency) Swap(i, j int)

type Calendar added in v0.2.2

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

Calendar is a little helper function that can work with synonym times

func NewCalendar added in v0.2.2

func NewCalendar(options ...func(*Calendar)) *Calendar

NewCalendar returns a new calendar object

func (Calendar) Date added in v0.3.0

func (c Calendar) Date(s string) (*time.Time, error)

Date returns a date in the future or past based on the given string. Can be a Synonym or any valid go time.Duration string

func (Calendar) Synonym added in v0.2.2

func (c Calendar) Synonym(s string) (time.Time, error)

Synonym returns a time.Time from a string Reference: https://taskwarrior.org/docs/dates/

type Comment added in v0.1.0

type Comment struct {
	Added   time.Time `json:"added,omitempty"`
	Comment string    `json:"comment,omitempty"`
}

Comment is just a little comment/note on a task

type Creator added in v0.0.2

type Creator func() TaskPlugin

Creator creats plugins

type Curator added in v0.3.1

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

Curator examines tasks and weights them, giving them a semi smart sense of urgency

func NewCurator added in v0.3.1

func NewCurator(options ...func(*Curator)) *Curator

NewCurator returns a new Curator instance with functional options

func (Curator) Weigh added in v0.3.1

func (c Curator) Weigh(t Task) float64

Weigh returns the weight of a task by a curator

type EffortImpact added in v0.1.0

type EffortImpact int

EffortImpact is the type for an effor/impact statement

const (
	// EffortImpactUnset is undefined EI
	EffortImpactUnset EffortImpact = iota
	// EffortImpactHigh is the highest
	EffortImpactHigh
	// EffortImpactMedium is medium
	EffortImpactMedium
	// EffortImpactLow is low
	EffortImpactLow
	// EffortImpactAvoid means stay away!
	EffortImpactAvoid
)

func (EffortImpact) Emoji added in v0.1.0

func (e EffortImpact) Emoji() string

Emoji returns a nice little visual queue for a given effort/impact statement

type Filter added in v0.0.10

type Filter func(*FilterParams, Task) bool

Filter is a filter function applied to a single task

type FilterParams added in v0.0.10

type FilterParams struct {
	Regex *regexp.Regexp
	Limit int
}

FilterParams are options for filtering tasks

type Option added in v0.0.10

type Option func() (func(*Poet), error)

Option helper for functional options with error reporting

func WithDatabasePath added in v0.0.10

func WithDatabasePath(s string) Option

WithDatabasePath gives the Poet a path to a database file

func WithNamespace added in v0.0.10

func WithNamespace(n string) Option

WithNamespace passes a namespace in to the new Poet object

func WithRecurringTasks added in v0.1.0

func WithRecurringTasks(r RecurringTasks) Option

WithRecurringTasks sets the recurring tasks for a poet

func WithStyling added in v0.2.0

func WithStyling(s themes.Styling) Option

WithStyling gives the poet a certain style at create

type Pagination added in v0.0.2

type Pagination struct {
	Limit   uint   `json:"limit"`
	Page    uint   `json:"page"`
	Sort    string `json:"sort"`
	HasMore bool   `json:"hasmore"`
}

Pagination is the pagination yo

type Poet added in v0.0.10

type Poet struct {
	DB        *bolt.DB
	Namespace string
	Default   Task
	Task      TaskService

	RecurringTasks RecurringTasks
	// contains filtered or unexported fields
}

Poet is the main operator for this whole thing

func MustNew added in v0.1.0

func MustNew(options ...Option) *Poet

MustNew returns a new poet object or panics

func New added in v0.0.10

func New(options ...Option) (*Poet, error)

New returns a new poet object and optional error

func (Poet) CompleteIDsWithPrefix added in v0.1.0

func (p Poet) CompleteIDsWithPrefix(prefix, toComplete string) []string

CompleteIDsWithPrefix returns a list of ids matching the given prefix and autocomplete pattern

func (*Poet) Delete added in v0.1.0

func (p *Poet) Delete(t *Task) error

Delete marks a task as deleted

func (*Poet) ImportTaskWarrior added in v0.1.0

func (p *Poet) ImportTaskWarrior(ts TaskWarriorTasks, c chan ProgressStatus) (int, error)

ImportTaskWarrior imports a set of TaskWarrior items and returns the number it imported, and an optional error

func (Poet) MustList added in v0.1.0

func (p Poet) MustList(s string) Tasks

MustList returns tasks from a prefix or panics

func (*Poet) TaskTable added in v0.0.10

func (p *Poet) TaskTable(opts TableOpts) string

TaskTable returns a table of the given tasks func (p *Poet) TaskTable(prefix string, fp FilterParams, filters ...Filter) string {

type ProgressModel added in v0.1.0

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

ProgressModel represents our fancy little progress bar

func NewProgressBar added in v0.1.0

func NewProgressBar(options ...func(*ProgressModel)) ProgressModel

NewProgressBar returns a new progress bar

func (ProgressModel) Init added in v0.1.0

func (m ProgressModel) Init() tea.Cmd

Init satisfies the model interface

func (ProgressModel) Update added in v0.1.0

func (m ProgressModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update satiesfies the model interface

func (ProgressModel) View added in v0.1.0

func (m ProgressModel) View() string

View satisfies the model interface

type ProgressStatus added in v0.1.0

type ProgressStatus struct {
	Current int64
	Total   int64
	Info    string
	Warning string
	Done    bool
}

ProgressStatus is a helper to show a progress bar on a bunch of item things

type RecurringTask added in v0.1.0

type RecurringTask struct {
	Description string        `yaml:"description"`
	Frequency   time.Duration `yaml:"frequency"`
}

RecurringTask is a task that recurs

type RecurringTasks added in v0.1.0

type RecurringTasks []RecurringTask

RecurringTasks represents multiple RecurringTask items

type RouterConfig added in v0.0.2

type RouterConfig struct {
	Debug       bool
	Port        uint
	LocalClient *Poet
}

RouterConfig configures the router

type Rows added in v0.3.1

type Rows [][]string

Rows consists of column and row strings

type Synonym added in v0.2.2

type Synonym string

Synonym is a helper for a relative time period

var (
	// Now is exactly now
	Now Synonym = "now"
	// Today is the beginning of the day today
	Today Synonym = "today"
	// EndOfday is the current date, end of the day
	EndOfday Synonym = "endofday"
	// Tomorrow is the next day, beginning of the day
	Tomorrow Synonym = "tomorrow"
	// StartOfDay is the current date, beginning of the day
	StartOfDay Synonym = "startofday"
	// Yesterday is the previous day, beginning of the day
	Yesterday Synonym = "yesterday"
	// StartOfYear is the start of next year, beginning of day
	StartOfYear Synonym = "startofyear"
	// EndOfYear is the end of this year, end of day
	EndOfYear Synonym = "endofyear"
	// Later is a date faaaaar away
	Later Synonym = "later"
	// EOM is the last day of the current month, end of the day
	EOM Synonym = "eom"
	// EOCM is the end of the current month, end of the day
	EOCM Synonym = "eocm"
	// SOM is the start of the next month, beginning of the day
	SOM Synonym = "som"
	// SOCM is the start of the current month, beginning of the day
	SOCM Synonym = "socm"
	// SOW is the start of the next week, beginning of the day
	SOW Synonym = "sow"
	// SOCW is the start of the current week, beginning of the day
	SOCW Synonym = "socw"
	// EOW is the end of the week, Saturday, beginning of the day
	EOW Synonym = "eow"
	// EOCW is the end of the week, Saturday, beginning of the day
	EOCW Synonym = "eocw"
	// SOWW is the start of the work week, beginning of the day
	SOWW Synonym = "soww"
	// EOWW is the end of the work week, end of the day
	EOWW Synonym = "eoww"

	/*
		Nth represents the n'th day of the month
	*/            // nolint
	First         Synonym = "1st"  // nolint
	Second        Synonym = "2nd"  // nolint
	Third         Synonym = "3rd"  // nolint
	Fourth        Synonym = "4th"  // nolint
	Fifth         Synonym = "5th"  // nolint
	Sixth         Synonym = "6th"  // nolint
	Seventh       Synonym = "7th"  // nolint
	Eight         Synonym = "8th"  // nolint
	Ninth         Synonym = "9th"  // nolint
	Tenth         Synonym = "10th" // nolint
	Eleventh      Synonym = "11th" // nolint
	Twelfth       Synonym = "12th" // nolint
	Thirteenth    Synonym = "13th" // nolint
	Fourteenth    Synonym = "14th" // nolint
	Fifthteenth   Synonym = "15th" // nolint
	Sixteenth     Synonym = "16th" // nolint
	Seventeenth   Synonym = "17th" // nolint
	Eightteenth   Synonym = "18th" // nolint
	Nineteenth    Synonym = "19th" // nolint
	Twentith      Synonym = "20th" // nolint
	TwentyFirst   Synonym = "21st" // nolint
	TwentySecond  Synonym = "22nd" // nolint
	TwentyThird   Synonym = "23rd" // nolint
	TwentyFourth  Synonym = "24th" // nolint
	TwentyFifth   Synonym = "25th" // nolint
	TwentySixth   Synonym = "26th" // nolint
	TwentySeventh Synonym = "27th" // nolint
	TwentyEith    Synonym = "28th" // nolint
	TwentyNinth   Synonym = "29th" // nolint
	Thirtyith     Synonym = "30th" // nolint
	ThirtyFirst   Synonym = "31st" // nolint

	January   Synonym = "january"   // nolint
	February  Synonym = "februrary" // nolint
	March     Synonym = "march"     // nolint
	April     Synonym = "april"     // nolint
	May       Synonym = "may"       // nolint
	June      Synonym = "june"      // nolint
	July      Synonym = "july"      // nolint
	August    Synonym = "august"    // nolint
	September Synonym = "september" // nolint
	October   Synonym = "october"   // nolint
	November  Synonym = "november"  // nolint
	December  Synonym = "december"  // nolint
	Monday    Synonym = "monday"    // nolint
	Tuesday   Synonym = "tuesday"   // nolint
	Wednesday Synonym = "wednesday" // nolint
	Thursday  Synonym = "thursday"  // nolint
	Friday    Synonym = "friday"    // nolint
	Saturday  Synonym = "saturday"  // nolint
	Sunday    Synonym = "sunday"    // nolint
)

func (Synonym) Aliases added in v0.3.0

func (s Synonym) Aliases() []string

Aliases returns a list of aliases for a Synonym

func (Synonym) Description added in v0.3.0

func (s Synonym) Description() string

Description returns a description for a Synonym

type TWAnnotation added in v0.1.0

type TWAnnotation struct {
	Entry       *TWTime `json:"entry,omitempty"`
	Description string  `json:"description,omitempty"`
}

TWAnnotation is a TaskWarrior Annotation

type TWTime added in v0.1.0

type TWTime time.Time

TWTime is the format that TaskWarrior uses for timestamps

func (TWTime) MarshalJSON added in v0.1.0

func (t TWTime) MarshalJSON() ([]byte, error)

MarshalJSON writes a quoted string in the custom format

func (*TWTime) String added in v0.1.0

func (t *TWTime) String() string

String returns the time in the custom format

func (*TWTime) UnmarshalJSON added in v0.1.0

func (t *TWTime) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Parses the json string in the custom format

type TableOpts added in v0.1.0

type TableOpts struct {
	Prefix       string
	FilterParams FilterParams
	Filters      []Filter
	Columns      []string
	SortBy       any
}

TableOpts defines the data displayed in a table

type Task

type Task struct {
	ID           string       `json:"id"`
	PluginID     string       `json:"plugin_id"`
	Description  string       `json:"description"`
	Due          *time.Time   `json:"due,omitempty"`
	HideUntil    *time.Time   `json:"hide_until,omitempty"`   // HideUntil is similar to 'wait' in taskwarrior
	CancelAfter  *time.Time   `json:"cancel_after,omitempty"` // CancelAfter is similar to 'until' in taskwarrior
	Completed    *time.Time   `json:"completed,omitempty"`
	Reviewed     *time.Time   `json:"reviewed,omitempty"`
	Deleted      *time.Time   `json:"deleted,omitempty"`
	Added        time.Time    `json:"added,omitempty"`
	EffortImpact EffortImpact `json:"effort_impact"`
	Children     []string     `json:"children,omitempty"`
	Parents      []string     `json:"parents,omitempty"`
	Tags         []string     `json:"tags,omitempty"`
	Comments     []Comment    `json:"comments,omitempty"`
	Project      string       `json:"project,omitempty"`
	Urgency      float64      `json:"urgency:omitempty"`
}

Task is the actual task item

func MustNewTask added in v0.1.0

func MustNewTask(description string, options ...TaskOption) *Task

MustNewTask returns a task or panics

func NewTask added in v0.1.0

func NewTask(desc string, options ...TaskOption) (*Task, error)

NewTask returns a new task given functional options

func (*Task) DetectKeyPath added in v0.0.2

func (t *Task) DetectKeyPath() []byte

DetectKeyPath finds the key path for a given task

func (*Task) ShortID added in v0.0.2

func (t *Task) ShortID() string

ShortID is just the first 5 characters of the ID

func (Task) Validate added in v0.1.0

func (t Task) Validate() error

Validate makes sure the task isn't malformed

type TaskOption added in v0.1.0

type TaskOption func(*Task)

TaskOption is a functional option for a new Task

func WithAdded added in v0.3.1

func WithAdded(d *time.Time) TaskOption

WithAdded sets the added date on create

func WithChildren added in v0.1.0

func WithChildren(c []string) TaskOption

WithChildren set the children of a task

func WithCompleted added in v0.1.0

func WithCompleted(d *time.Time) TaskOption

WithCompleted sets the completed date on create

func WithDescription added in v0.1.0

func WithDescription(d string) TaskOption

WithDescription sets the description on create

func WithDue added in v0.1.0

func WithDue(d *time.Time) TaskOption

WithDue sets the due date on create

func WithEffortImpact added in v0.1.0

func WithEffortImpact(e EffortImpact) TaskOption

WithEffortImpact sets the impact statement on create

func WithHideUntil added in v0.1.0

func WithHideUntil(d *time.Time) TaskOption

WithHideUntil sets the hide until on create

func WithID added in v0.1.0

func WithID(i string) TaskOption

WithID sets the UUID on create

func WithParents added in v0.1.0

func WithParents(p []string) TaskOption

WithParents set the parents of a task

func WithTags added in v0.1.0

func WithTags(s []string) TaskOption

WithTags sets the tags on create

func WithTaskWarriorTask added in v0.1.0

func WithTaskWarriorTask(twItem TaskWarriorTask) TaskOption

WithTaskWarriorTask imports a task from a task warrior task

type TaskPlugin added in v0.0.2

type TaskPlugin interface {
	ExampleConfig() string
	Description() string
	Sync() ([]Task, error)
}

TaskPlugin describes what a plugin is

type TaskService

type TaskService interface {
	// This should replace New, and Log
	Add(t *Task) (*Task, error)
	AddSet(t Tasks) error

	// Helper for adding Parent
	AddParent(c, p *Task) error
	AddChild(p, c *Task) error

	// Describe something
	Describe(t *Task) error

	// Edit a Task entry
	Edit(t *Task) (*Task, error)
	EditSet(t []Task) error

	// Should we use this instead of above funcs?
	AddOrEditSet(tasks []Task) error

	// Purge completely removes a task out of the DB
	Purge(t *Task) error

	// Complete a task
	Complete(t *Task) error

	// Sweet lord, this gettin' confusin' Drew
	GetPlugins() (map[string]Creator, error)
	SyncPlugin(TaskPlugin) error

	// States of a Task
	GetStates() []string
	GetStatePaths() []string

	// Just a little helper function to add and immediately mark as completed
	Log(t, d *Task) (*Task, error)

	// This on prolly needs work
	List(prefix string) (Tasks, error)
	/*
	   Path Conventions
	   /${state}/${plugin-id}/${id}
	   $state -> Active or Completed
	   $plugin-id -> Could be 'default'...or ”...or 'plugin-1'
	   $id -> Unique identifier

	   $plugin-id/$id should be unique together. Think things like:
	   gitlab.com/ISSUE-2
	   gitlab.local.io/ISSUE-2
	*/
	// New way to get stuff
	GetWithID(id, pluginID, state string) (*Task, error)
	GetWithPartialID(partialID, pluginID, state string) (*Task, error)
	GetWithExactPath(path []byte) (*Task, error)

	// Old way to get stuff, delete soon
	GetIDsByPrefix(prefix string) ([]string, error)
}

TaskService is the interface to tasks...we'll delete this junk

type TaskServiceOp

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

TaskServiceOp is the TaskService Operator

func (*TaskServiceOp) Add added in v0.0.2

func (svc *TaskServiceOp) Add(t *Task) (*Task, error)

Add adds a new task

func (*TaskServiceOp) AddChild added in v0.0.2

func (svc *TaskServiceOp) AddChild(p, c *Task) error

AddChild adds a child to a parent

func (*TaskServiceOp) AddOrEditSet added in v0.0.2

func (svc *TaskServiceOp) AddOrEditSet(tasks []Task) error

AddOrEditSet adds or edits a set of tasks

func (*TaskServiceOp) AddParent added in v0.0.2

func (svc *TaskServiceOp) AddParent(c, p *Task) error

AddParent adds a parent to a child command

func (*TaskServiceOp) AddSet added in v0.0.2

func (svc *TaskServiceOp) AddSet(t Tasks) error

AddSet adds a task set

func (*TaskServiceOp) Complete

func (svc *TaskServiceOp) Complete(t *Task) error

Complete marks a task as completed

func (*TaskServiceOp) Describe added in v0.0.2

func (svc *TaskServiceOp) Describe(t *Task) error

Describe describes a task

func (*TaskServiceOp) Edit added in v0.0.2

func (svc *TaskServiceOp) Edit(t *Task) (*Task, error)

Edit edits an existing task

func (*TaskServiceOp) EditSet added in v0.0.2

func (svc *TaskServiceOp) EditSet(tasks []Task) error

EditSet edits a single set of tasks

func (*TaskServiceOp) GetIDsByPrefix

func (svc *TaskServiceOp) GetIDsByPrefix(prefix string) ([]string, error)

GetIDsByPrefix returns a list of ids matching the given prefix

func (*TaskServiceOp) GetPlugins added in v0.0.2

func (svc *TaskServiceOp) GetPlugins() (map[string]Creator, error)

GetPlugins returns all plugins

func (*TaskServiceOp) GetStatePaths added in v0.0.2

func (svc *TaskServiceOp) GetStatePaths() []string

GetStatePaths is each of the states with a / prefix i guess

func (*TaskServiceOp) GetStates added in v0.0.2

func (svc *TaskServiceOp) GetStates() []string

GetStates returns types of states

func (*TaskServiceOp) GetWithExactPath added in v0.0.2

func (svc *TaskServiceOp) GetWithExactPath(path []byte) (*Task, error)

GetWithExactPath returns a task from an exact path

func (*TaskServiceOp) GetWithID added in v0.0.2

func (svc *TaskServiceOp) GetWithID(id, pluginID, state string) (*Task, error)

GetWithID returns a task from an ID

func (*TaskServiceOp) GetWithPartialID added in v0.0.2

func (svc *TaskServiceOp) GetWithPartialID(partialID, pluginID, state string) (*Task, error)

GetWithPartialID returns using a partial id of the task

func (*TaskServiceOp) List

func (svc *TaskServiceOp) List(prefix string) (Tasks, error)

List lists items under a given prefix

func (*TaskServiceOp) Log

func (svc *TaskServiceOp) Log(t *Task, d *Task) (*Task, error)

Log is a Shortcut utility to add a new task, but a completed time of 'now'

func (*TaskServiceOp) Purge added in v0.1.0

func (svc *TaskServiceOp) Purge(t *Task) error

Purge removes a task from the database

func (*TaskServiceOp) SyncPlugin added in v0.0.2

func (svc *TaskServiceOp) SyncPlugin(tp TaskPlugin) error

SyncPlugin syncs a plugin or whatever

type TaskWarriorTask added in v0.1.0

type TaskWarriorTask struct {
	ID          int64          `json:"id,omitempty"`
	Description string         `json:"description,omitempty"`
	UUID        string         `json:"uuid,omitempty"`
	Status      string         `json:"status,omitempty"`
	Entry       *TWTime        `json:"entry,omitempty"`
	Modified    *TWTime        `json:"modified,omitempty"`
	Due         *TWTime        `json:"due,omitempty"`
	Wait        *TWTime        `json:"wait,omitempty"`
	End         *TWTime        `json:"end,omitempty"`
	Reviewed    *TWTime        `json:"reviewed,omitempty"`
	Until       *TWTime        `json:"until,omitempty"`
	Mask        string         `json:"mask,omitempty"`
	Urgency     float64        `json:"urgency,omitempty"`
	Tags        []string       `json:"tags,omitempty"`
	Annotations []TWAnnotation `json:"annotations,omitempty"`
}

TaskWarriorTask is a task from TaskWarrior

type TaskWarriorTasks added in v0.1.0

type TaskWarriorTasks []TaskWarriorTask

TaskWarriorTasks is multiple TaskWarriorTasks items

type Tasks added in v0.0.10

type Tasks []*Task

Tasks represents multiple Task items

func ApplyFilters added in v0.0.10

func ApplyFilters(tasks Tasks, p *FilterParams, filters ...Filter) Tasks

ApplyFilters applies a set of filters to a task list. Each record will be checked against each filter. The filters are applied in the order they are passed in.

func (Tasks) Len added in v0.0.10

func (t Tasks) Len() int

Len helps to satisfy the sort interface

func (Tasks) Less added in v0.0.10

func (t Tasks) Less(i, j int) bool

Less helps to satisfy the sort interface

func (*Tasks) SortBy added in v0.3.1

func (t *Tasks) SortBy(s any)

SortBy specifies how to sort the tasks

func (Tasks) Swap added in v0.0.10

func (t Tasks) Swap(i, j int)

Swap helps to satisfy the sort interface

Jump to

Keyboard shortcuts

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