dql

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

dql

DOM Query Language

Documentation

Index

Constants

View Source
const (
	XGoPackage = true
)

Variables

View Source
var (
	ErrNotFound      = errors.New("entity not found")
	ErrMultiEntities = errors.New("too many entities found")
)

Functions

func Collect

func Collect[T any, Seq ~func(func(T) bool)](seq Seq) []T

Collect retrieves all items from the provided sequence.

func First

func First[T any, Seq ~func(func(T) bool)](seq Seq) (ret T, err error)

First retrieves the first item from the provided sequence. If the sequence is empty, it returns ErrNotFound.

func Int

func Int(text string) (int, error)

Int parses the given string as an integer, removing any commas and trimming whitespace.

func NopIter

func NopIter[T any](yield func(T) bool)

NopIter is a no-operation iterator that yields no values.

func Single

func Single[T any, Seq ~func(func(T) bool)](seq Seq) (ret T, err error)

Single retrieves a single item from the provided sequence. If the sequence is empty, it returns ErrNotFound. If the sequence contains more than one item, it returns ErrMultiEntities.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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