query

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package query contains the shared read-query inputs and operations.

Index

Constants

View Source
const (
	ScopeOpen     = "open"
	ScopeProposed = "proposed"
	ScopeDone     = "done"
	ScopeArchived = "archived"
	ScopeAll      = "all"
	// ScopeRejected is the declined-proposal review scope: CANCELLED tasks
	// carrying the `rejected` marker, live and recently archived, newest first.
	// It is a lifecycle scope like the others, so it is mutually exclusive with
	// them, and it is never the default — a decline stays out of every ordinary
	// view until it is asked for by name.
	ScopeRejected = "rejected"
)

Variables

This section is empty.

Functions

func CoerceBool

func CoerceBool(value any) bool

CoerceBool mirrors Ruby's `!!value`, the coercion TaskFilter#initialize applies to every boolean keyword. Only nil and false are false in Ruby: `0` and `""` are truthy, so JSON falsiness must not be mapped onto it.

func CoerceString

func CoerceString(value any) string

CoerceString mirrors Ruby's `value.to_s`, the coercion TaskFilter#initialize applies to scope, priority, and state before any domain rule sees them. A dynamic boundary applies it so a non-String value is rejected by the ported domain message rather than by a decoder.

func CoerceStrings

func CoerceStrings(value any) []string

CoerceStrings mirrors Ruby's `Array(values).map { |value| value.to_s }`, the coercion TaskFilter#initialize applies to contexts, tags, and text before any other rule sees them. Go's typed constructor cannot express it, so dynamic boundaries (the JSON kwargs probe, and later any dynamic adapter) apply this rule before building FilterOptions rather than rejecting the input.

The value is a JSON document decoded into Go's generic shapes, with numbers preserved as json.Number so integers stay integers as they do in Ruby.

func DecodeValue

func DecodeValue(document []byte) (any, error)

DecodeValue decodes one JSON document into the shapes this file renders: nil, bool, string, json.Number, []any, and Object. It is the only decoder a dynamic boundary may use — `encoding/json`'s generic decode loses both Hash order and the distinction between an integer and a float literal.

func Downcase

func Downcase(value string) string

Downcase is Ruby's String#downcase, which strings.ToLower alone is not: it applies the one unconditional multi-character mapping and the case pairs added in Unicode versions newer than Go's tables. Every surface that folds case for comparison — the text filter, the title index, ref resolution — goes through here, so there is one place for that difference to live.

func InspectSymbol

func InspectSymbol(name string) string

InspectSymbol mirrors Ruby's Symbol#inspect, which is how the interpreter renders an unrecognised keyword name in the ArgumentError it raises before TaskFilter#initialize runs. A name the parser would accept as a symbol literal prints bare; anything else is quoted with String#inspect.

Types

type Entry

type Entry struct {
	Key   string
	Value any
}

Entry is one Hash pair. Keys are always Strings: JSON has no other key type.

type Filter

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

Filter is the immutable selection input shared by read adapters.

func NewFilter

func NewFilter(options FilterOptions) (Filter, error)

NewFilter validates and normalizes one filter value.

func (Filter) AgentReadyOnly

func (filter Filter) AgentReadyOnly() bool

func (Filter) BodySearch

func (filter Filter) BodySearch() bool

func (Filter) Contexts

func (filter Filter) Contexts() []string

func (Filter) DeferredOnly

func (filter Filter) DeferredOnly() bool

func (Filter) DelegatedOnly

func (filter Filter) DelegatedOnly() bool

func (Filter) IncludeArchive

func (filter Filter) IncludeArchive() bool

func (Filter) Priority

func (filter Filter) Priority() string

func (Filter) RecurringOnly

func (filter Filter) RecurringOnly() bool

func (Filter) RejectedOnly added in v1.9.0

func (filter Filter) RejectedOnly() bool

RejectedOnly reports the declined-proposal scope, which narrows CANCELLED to the rows carrying the decline marker and orders them newest first.

func (Filter) Scope

func (filter Filter) Scope() string

func (Filter) SomedayOnly

func (filter Filter) SomedayOnly() bool

func (Filter) State

func (filter Filter) State() string

func (Filter) States

func (filter Filter) States() []string

func (Filter) Tags

func (filter Filter) Tags() []string

func (Filter) Text

func (filter Filter) Text() []string

func (Filter) TextQuery

func (filter Filter) TextQuery() string

func (Filter) UnavailableOnly

func (filter Filter) UnavailableOnly() bool

type FilterOptions

type FilterOptions struct {
	Scope           *string  `json:"scope"`
	DeferredOnly    bool     `json:"deferred_only"`
	UnavailableOnly bool     `json:"unavailable_only"`
	SomedayOnly     bool     `json:"someday_only"`
	RecurringOnly   bool     `json:"recurring_only"`
	BodySearch      bool     `json:"body_search"`
	DelegatedOnly   bool     `json:"delegated_only"`
	AgentReadyOnly  bool     `json:"agent_ready_only"`
	Contexts        []string `json:"contexts"`
	Tags            []string `json:"tags"`
	Priority        *string  `json:"priority"`
	State           *string  `json:"state"`
	Text            []string `json:"text"`
}

FilterOptions supplies Filter's constructor fields.

type Object

type Object []Entry

Object is a Ruby Hash as it arrives from JSON. Ruby's Hash preserves insertion order and JSON.parse inserts in document order, so `to_s` renders keys in the order the caller wrote them. A Go map cannot carry that order, so the boundary decoder produces this instead and no map ever reaches the rendering below.

type ParsedFilter

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

ParsedFilter is the legacy list syntax plus its JSON rendering switch.

func ParseCLI

func ParseCLI(args []string) (ParsedFilter, error)

ParseCLI translates the legacy list arguments into a Filter.

func (ParsedFilter) Filter

func (parsed ParsedFilter) Filter() Filter

func (ParsedFilter) JSON

func (parsed ParsedFilter) JSON() bool

Jump to

Keyboard shortcuts

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