filters

package
v0.8.15 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Equals            string = "="
	In                string = "in"
	Contains          string = "contains"
	NotEquals         string = "!="
	GreaterThan       string = ">"
	GreaterThanEquals string = ">="
	LessThan          string = "<"
	LessThanEquals    string = "<="
)

Variables

View Source
var (
	InReg       = regexp.MustCompile(` in `)
	ContainsReg = regexp.MustCompile(` contains `)
	InRegValue  = regexp.MustCompile(`(?s)\((.*)\)`)
)
View Source
var (
	DefaultLimit  int32 = 100
	DefaultFilter       = Filters{
		Limit:  DefaultLimit,
		Page:   1,
		SortBy: "created_at",
		Asc:    false,
	}
)

Functions

func BuildNamedEntityListRequest added in v0.5.12

func BuildNamedEntityListRequest(c Filters, project, domain string, resourceType core.ResourceType) (*admin.NamedEntityListRequest, error)

func BuildProjectListRequest

func BuildProjectListRequest(c Filters) (*admin.ProjectListRequest, error)

func BuildResourceListRequestWithName

func BuildResourceListRequestWithName(c Filters, project, domain, name string) (*admin.ResourceListRequest, error)

func EscapeValue added in v0.7.0

func EscapeValue(s string) string

EscapeValue escapes strings to be used as values in filter queries.

func SplitTerms

func SplitTerms(filter string) []string

SplitTerms split the filter string and returns the map of strings

func Transform

func Transform(filters []string) (string, error)

Transform transform the field selector term from string to flyteadmin field selector syntax

func UnescapeValue

func UnescapeValue(s string) (string, error)

UnescapeValue unescapes a fieldSelector value and returns the original literal value. May return the original string if it contains no escaped or special characters.

Types

type Filters

type Filters struct {
	FieldSelector string `json:"fieldSelector" pflag:",Specifies the Field selector"`
	SortBy        string `json:"sortBy" pflag:",Specifies which field to sort results "`
	Limit         int32  `json:"limit" pflag:",Specifies the limit"`
	Asc           bool   `json:"asc"  pflag:",Specifies the sorting order. By default flytectl sort result in descending order"`
	Page          int32  `json:"page" pflag:",Specifies the page number, in case there are multiple pages of results"`
}

type InvalidEscapeSequence

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

InvalidEscapeSequence indicates an error occurred unescaping a field selector

func (InvalidEscapeSequence) Error

func (i InvalidEscapeSequence) Error() string

type UnescapedRune

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

UnescapedRune indicates an error occurred unescaping a field selector

func (UnescapedRune) Error

func (i UnescapedRune) Error() string

Jump to

Keyboard shortcuts

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