sqltypes

package
v0.8.22 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExternalDependency added in v0.6.19

type ExternalDependency struct {
	SourceGVK            string
	SourceFieldName      string
	TargetGVK            string
	TargetKeyFieldName   string
	TargetFinalFieldName string
}

type ExternalGVKDependency added in v0.6.19

type ExternalGVKDependency map[schema.GroupVersionKind]*ExternalGVKUpdates

type ExternalGVKUpdates added in v0.6.19

type ExternalGVKUpdates struct {
	AffectedGVK               schema.GroupVersionKind
	ExternalDependencies      []ExternalDependency
	ExternalLabelDependencies []ExternalLabelDependency
}

type ExternalInfoPacket added in v0.6.19

type ExternalInfoPacket struct {
	ExternalDependencies      []ExternalDependency
	ExternalLabelDependencies []ExternalLabelDependency
	ExternalGVKDependencies   ExternalGVKDependency
}

type ExternalLabelDependency added in v0.6.19

type ExternalLabelDependency struct {
	SourceGVK string
	TargetGVK string

	SourceLabelTargetField map[string]string

	TargetFinalFieldName string
	// contains filtered or unexported fields
}

func MustNewExternalLabelDependency added in v0.8.22

func MustNewExternalLabelDependency(eld ExternalLabelDependency) ExternalLabelDependency

func NewExternalLabelDependency added in v0.8.22

func NewExternalLabelDependency(eld ExternalLabelDependency) (ExternalLabelDependency, error)

NewExternalLabelDependency pre-generates the query needed for the label and key pairs. No labels in ExternalLabelDependency are user supplied, making risk of potential SQL injection minimal.

func (ExternalLabelDependency) Query added in v0.8.22

func (d ExternalLabelDependency) Query() string

type Filter

type Filter struct {
	Field   []string
	Matches []string
	Op      Op
	Partial bool
}

Filter represents a field to filter by. A subfield in an object is represented in a request query using . notation, e.g. 'metadata.name'. The subfield is internally represented as a slice, e.g. [metadata, name]. Complex subfields need to be expressed with square brackets, as in `metadata.labels[example.com/moose]`, but are mapped to the string slice ["metadata", "labels", "example.com/moose"]

If more than one value is given for the `Match` field, we do an "IN (<values>)" test

type ListOptions

type ListOptions struct {
	Filters               []OrFilter
	ProjectsOrNamespaces  OrFilter
	SortList              SortList
	SummaryFieldList      SummaryFieldList
	Pagination            Pagination
	IncludeAssociatedData bool
	Revision              string
}

ListOptions represents the query parameters that may be included in a list request.

type Op

type Op string
const (
	Eq          Op = "="
	NotEq       Op = "!="
	Exists      Op = "Exists"
	NotExists   Op = "NotExists"
	In          Op = "In"
	NotIn       Op = "NotIn"
	Contains    Op = "Contains"
	NotContains Op = "NotContains"
	Lt          Op = "Lt"
	Gt          Op = "Gt"
)

type OrFilter

type OrFilter struct {
	Filters []Filter
}

OrFilter represents a set of possible fields to filter by, where an item may match any filter in the set to be included in the result.

type Pagination

type Pagination struct {
	PageSize int
	Page     int
}

Pagination represents how to return paginated results.

type Sort

type Sort struct {
	Fields   []string
	Order    SortOrder
	SortAsIP bool
}

Sort represents the criteria to sort on. The subfield to sort by is represented in a request query using . notation, e.g. 'metadata.name'. The subfield is internally represented as a slice, e.g. [metadata, name]. The order is represented by prefixing the sort key by '-', e.g. sort=-metadata.name. e.g. To sort internal clusters first followed by clusters in alpha order: sort=-spec.internal,spec.displayName

type SortList

type SortList struct {
	SortDirectives []Sort
}

func NewSortList

func NewSortList() *SortList

type SortOrder

type SortOrder int

SortOrder represents whether the list should be ascending or descending.

const (
	// ASC stands for ascending order.
	ASC SortOrder = iota
	// DESC stands for descending (reverse) order.
	DESC
)

type SummaryFieldList added in v0.8.1

type SummaryFieldList [][]string

Jump to

Keyboard shortcuts

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