query

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(expr string, fm map[string]any) (bool, error)

Match is a convenience function that compiles expr and tests fm in a single call. Returns an error only if the CUE expression is invalid.

Types

type Matcher

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

Matcher holds a pre-compiled CUE expression for matching against front matter maps.

func Compile

func Compile(expr string) (*Matcher, error)

Compile parses a CUE struct literal body and returns a Matcher. Returns an error if the expression is invalid.

func (*Matcher) Match

func (m *Matcher) Match(fm map[string]any) bool

Match reports whether fm satisfies the compiled CUE expression. A nil or empty map never matches an expression that requires fields.

Jump to

Keyboard shortcuts

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