selectors

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Selectors

type Selectors map[string]map[string]bool

Selectors stores selector key-value pairs where values are stored in inner maps Multiple values for the same key use OR logic (match any value in the inner map) Each value can be represented exactly once per key

func (*Selectors) GetValue

func (s *Selectors) GetValue(key, value string) bool

GetValue returns true if the given value exists in the inner map for the given key. Returns false if the key doesn't exist or the value is not present.

func (*Selectors) MatchesIncludes

func (includes *Selectors) MatchesIncludes(frontmatter markdown.BaseFrontMatter) bool

MatchesIncludes returns true if the frontmatter matches all include selectors. If a key doesn't exist in frontmatter, it's allowed. Multiple values for the same key use OR logic (matches if frontmatter value is in the inner map). This enables combining CLI selectors (-s flag) with task frontmatter selectors: both are added to the same Selectors map, creating an OR condition for rules to match.

func (*Selectors) Set

func (s *Selectors) Set(value string) error

Set implements the flag.Value interface for Selectors

func (*Selectors) SetValue

func (s *Selectors) SetValue(key, value string)

SetValue sets a value in the inner map for the given key. If the key doesn't exist, it creates a new inner map. Each value can be represented exactly once per key.

func (*Selectors) String

func (s *Selectors) String() string

String implements the fmt.Stringer interface for Selectors

Jump to

Keyboard shortcuts

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