filters

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongOperator = fmt.Errorf(
		"wrong operator, try: \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\"",
		EqualFilterType, NotEqualFilterType, AboveFilterType, AboveOrEqualFilterType, LessFilterType, LessOrEqualFilterType, InFilterType, ToFilterType,
	)
	ErrOnlyOneValue  = errors.New("errors values: must contain one value")
	ErrOnlyTwoValues = errors.New("errors values: must contain two values")
)
View Source
var Int64MapAttr = schema.MapAttribute{
	ElementType: types.Int64Type,
	Computed:    true,
}

Functions

func Apply

func Apply(physicalPorts []autonomisdkmodel.PhysicalPort, filtersTerraform []Filter) ([]autonomisdkmodel.PhysicalPort, error)

func GetFiltersString

func GetFiltersString(fs []Filter) ([]string, error)

func GetSortString

func GetSortString(sorts []SortFacet) []string

Types

type Filter

type Filter struct {
	Name     types.String `tfsdk:"name"`
	Operator types.String `tfsdk:"operator"`
	Values   types.List   `tfsdk:"values"`
}

type FilterType

type FilterType string
const (
	EqualFilterType        FilterType = "="
	NotEqualFilterType     FilterType = "!="
	AboveFilterType        FilterType = ">"
	AboveOrEqualFilterType FilterType = ">="
	LessFilterType         FilterType = "<"
	LessOrEqualFilterType  FilterType = "<="
	InFilterType           FilterType = "IN"
	ToFilterType           FilterType = "TO"
)

func (FilterType) String

func (ft FilterType) String() string

type SortFacet

type SortFacet struct {
	Name  types.String `tfsdk:"name"`
	Value types.String `tfsdk:"value"`
}

Jump to

Keyboard shortcuts

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