filters

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRSQLExpression

func BuildRSQLExpression(filters []FilterModel, selectorValidator SelectorValidator) string

BuildRSQLExpression concatenates filter clauses into a reusable RSQL string.

func Clause added in v0.11.0

func Clause(selector, operator, argument string) string

Clause builds a selector/operator/argument clause using Terraform-style escaping.

func FilterAttribute added in v0.13.0

func FilterAttribute(selectorDescription string, validSelectors []string) schema.ListNestedAttribute

FilterAttribute builds the shared schema for declarative RSQL filter clauses as a nested attribute.

func FormatArgument added in v0.11.0

func FormatArgument(value string) string

FormatArgument prepares an RSQL argument value, adding quotes/escapes when needed.

func ListFilterAttribute added in v0.13.0

func ListFilterAttribute(selectorDescription string, validSelectors []string) listschema.ListNestedAttribute

ListFilterAttribute builds the shared schema for list resources that support RSQL filters.

func SelectorDescription

func SelectorDescription(selectors []string) string

SelectorDescription builds the Markdown sentence that advertises the valid selectors.

Types

type FilterModel

type FilterModel struct {
	Selector              types.String `tfsdk:"selector"`
	Operator              types.String `tfsdk:"operator"`
	Argument              types.String `tfsdk:"argument"`
	JoinWith              types.String `tfsdk:"join_with"`
	HasOpeningParenthesis types.Bool   `tfsdk:"has_opening_parenthesis"`
	HasClosingParenthesis types.Bool   `tfsdk:"has_closing_parenthesis"`
}

FilterModel represents a single declarative filter clause provided by a data source.

type SelectorValidator

type SelectorValidator func(string) bool

SelectorValidator returns true when a selector is permitted for the data source.

func AllowList

func AllowList(validSelectors []string) SelectorValidator

AllowList returns a selector validator that permits only selectors from the provided list.

Jump to

Keyboard shortcuts

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