filter

package
v0.59.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFilterAttributes

func AddFilterAttributes(r *schema.Resource, s map[string]*schema.Schema)

AddFilterAttributes adds filter attributes to your resource for all bool, int, string and map[string]string attributes in the supplied schema. In combination with CreateFilters you may use this to create aggregate data sources with filtering functionality.

func CheckForMatch

func CheckForMatch(data map[string]interface{}, filters []FilterFunc) bool

CheckForMatch returns true if all filters match on the given data.

func GetFilteredFields added in v0.53.2

func GetFilteredFields(ctx context.Context, d *schema.ResourceData, s map[string]*schema.Schema) map[string]struct{}

Types

type FilterFunc

type FilterFunc = func(map[string]interface{}) bool

func CreateFilters

func CreateFilters(ctx context.Context, d *schema.ResourceData, s map[string]*schema.Schema) ([]FilterFunc, error)

CreateFilters accepts a schema for a data source and creates a filter.FilterFunc for each attribute of type bool, int, string or map[string]string. Use these filters to create aggregate data sources like lists.

Jump to

Keyboard shortcuts

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