utils

package
v1.17.0-beta10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTypesNotEqual = fmt.Errorf("types not equal")
	ErrNotSettable   = fmt.Errorf("can't set value")
)

Functions

func FindAppliedRouteFilter

func FindAppliedRouteFilter(
	routeCtx *plugins.RouteContext,
	filterType gwv1.HTTPRouteFilterType,
) *gwv1.HTTPRouteFilter

Finds the first instance of the filterType supplied in the Rule being processed. Returns nil if the Rule doesn't contain a filter of the provided Type

func FindAppliedRouteFilters

func FindAppliedRouteFilters(
	routeCtx *plugins.RouteContext,
	filterTypes ...gwv1.HTTPRouteFilterType,
) []gwv1.HTTPRouteFilter

Finds all instances of the supplied filterTypes for the Rule supplied in the RouteContext. Should only be used for plugins that support multiple filters as part of a single Rule

func FindExtensionRefFilter

func FindExtensionRefFilter(
	routeCtx *plugins.RouteContext,
	gk schema.GroupKind,
) *gwv1.HTTPRouteFilter

Finds the first instance of an ExtensionRef filter that references the supplied GroupKind in the Rule being processed. Returns nil if the Rule doesn't contain a matching ExtensionRef filter

func GetExtensionRefObj

func GetExtensionRefObj(
	ctx context.Context,
	routeCtx *plugins.RouteContext,
	queries query.GatewayQueries,
	extensionRef *gwv1.LocalObjectReference,
	obj client.Object,
) error

Uses the provided query engine to retrieve an ExtensionRef object and set the value of `obj` to point to it. The type of `obj` must match the type referenced in the extensionRef and must be a pointer. An error will be returned if the Get was unsuccessful or if the type passed is not valid. A nil error indicates success and `obj` should be usable as normal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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