filters

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 5 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,
		SortBy: "created_at",
		Asc:    false,
	}
)

Functions

func BuildProjectListRequest

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

func BuildResourceListRequestWithName

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

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 "`
	// TODO: Support paginated queries
	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"`
}

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