Documentation
¶
Index ¶
- func BuildRSQLExpression(filters []FilterModel, selectorValidator SelectorValidator) string
- func Clause(selector, operator, argument string) string
- func FilterAttribute(selectorDescription string, validSelectors []string) schema.ListNestedAttribute
- func FormatArgument(value string) string
- func ListFilterAttribute(selectorDescription string, validSelectors []string) listschema.ListNestedAttribute
- func SelectorDescription(selectors []string) string
- type FilterModel
- type SelectorValidator
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
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
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 ¶
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 ¶
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.