cirql

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 4 Imported by: 0

README

Documentation

Overview

Package cirql is the public entry point to the cirql JSON pipeline language: Parse compiles a query string into a Pipeline, and Pipeline.Run executes it over a decoded JSON value. The language, evaluator, and stages live in the sub-packages; this package wires them together.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(config) config

Option configures Parse: it returns the config with the option applied.

func WithClock

func WithClock(now func() int64) Option

WithClock injects the clock the now() builtin reads (epoch seconds), making time-dependent queries deterministic in tests.

type Pipeline

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

Pipeline is a compiled cirql query ready to run.

func Parse

func Parse(query Query, opts ...Option) (Pipeline, error)

Parse compiles a cirql query into a Pipeline. It returns the dialect's ErrParse on a syntax error, or stage.ErrStageUnsupported when the query uses a source stage this build does not execute.

func (Pipeline) Run

func (p Pipeline) Run(in value.Value) ([]value.Value, error)

Run executes the pipeline over a decoded JSON value, normalizing it into the initial result set and threading it through every stage.

type Query

type Query = dialect.Query

Query is the raw text of a cirql query.

Directories

Path Synopsis
Package ast defines the cirql abstract syntax tree: the typed pipeline, stages, and expressions a parsed query produces.
Package ast defines the cirql abstract syntax tree: the typed pipeline, stages, and expressions a parsed query produces.
Package eval evaluates cirql expressions against an environment: the current object (for field access), the variable bindings (for $var), and an injected clock (for now()).
Package eval evaluates cirql expressions against an environment: the current object (for field access), the variable bindings (for $var), and an injected clock (for now()).
Package pipeline holds the cirql result-set model and the sequential stage runner.
Package pipeline holds the cirql result-set model and the sequential stage runner.
pkg
dialect/cirql
Package cirql is the covered seam over the generated ANTLR parser: it turns a cirql query string into a typed ast.Pipeline and any syntax error into the ErrParse sentinel.
Package cirql is the covered seam over the generated ANTLR parser: it turns a cirql query string into a typed ast.Pipeline and any syntax error into the ErrParse sentinel.
src
Package stage implements the cirql transform stages and Build, which maps a parsed stage node to its executor.
Package stage implements the cirql transform stages and Build, which maps a parsed stage node to its executor.

Jump to

Keyboard shortcuts

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