filter

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package filter applies field-based filters to task collections.

Filters use a "field<op>value" expression syntax with AND logic across multiple criteria. The default operator is "=" (exact match). The priority and effort fields also support ordering operators: >, >=, <, <=.

Supported fields include status, priority, effort, type, group, tags, and assignee.

The effort vocabulary is project-configurable, so Apply takes an github.com/driangle/taskmd/sdk/go/effort.Scale that supplies both the accepted values and their order. Pass the zero Scale for the default small, medium, large.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(tasks []*model.Task, filterExprs []string, efforts effort.Scale) ([]*model.Task, error)

Apply applies multiple filter expressions to tasks (AND logic).

efforts supplies the project's effort vocabulary, which determines the values accepted by effort comparisons such as "effort>small". Pass effort.Scale{} for the default vocabulary.

func MatchScope

func MatchScope(pattern, scope string) bool

MatchScope checks whether a scope value matches a pattern. The only supported wildcard is '*', which matches zero or more characters including '/'. Scopes are logical identifiers (e.g. "cli/import") so "cli*" matches "cli", "cli/import", etc. Without a wildcard, exact string equality is used.

Types

type Criteria

type Criteria struct {
	Field string
	Op    string // "=", ">", ">=", "<", "<="
	Value string
}

Criteria represents a single filter condition.

Jump to

Keyboard shortcuts

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