gateway

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ControllerDomain is the domain for this Gateway Controller.
	ControllerDomain gatewayv1.GatewayController = "caddyserver.com"
	// ControllerName is the name of this Gateway Controller, used in Gateway Classes.
	ControllerName = ControllerDomain + "/gateway-controller"
)

Variables

This section is empty.

Functions

func ComputeHosts

func ComputeHosts(routeHostnames []string, listenerHostname *string) []string

ComputeHosts returns a list of the intersecting hostnames between the route and the listener. The below function is inspired from https://github.com/envoyproxy/gateway/blob/main/internal/gatewayapi/helpers.go. Special thanks to Envoy team.

func GetBackendServiceName

func GetBackendServiceName(bor gatewayv1.BackendObjectReference) (string, error)

GetBackendServiceName attempts to get the name of a Service from a BackendObjectReference. Returns an error if the BackendObjectReference doesn't reference a Service resource.

func IsBackendReferenceAllowed

func IsBackendReferenceAllowed(originatingNamespace string, be gatewayv1.BackendRef, gvk schema.GroupVersionKind, grants []gatewayv1beta1.ReferenceGrant) bool

IsBackendReferenceAllowed returns true if the backend reference is allowed by the reference grant.

func IsGateway

func IsGateway(parent gatewayv1.ParentReference) bool

IsGateway checks if the given ParentReference references a Gateway resource.

func IsLocalConfigMap

func IsLocalConfigMap(be gatewayv1.LocalObjectReference) bool

IsLocalConfigMap checks if the given LocalObjectReference references a ConfigMap resource.

func IsLocalPolicyTargetService added in v0.1.0

func IsLocalPolicyTargetService(be gatewayv1alpha2.LocalPolicyTargetReference) bool

IsPolicyTargetService checks if the given PolicyTargetReference references a Service resource.

func IsLocalSecret

func IsLocalSecret(be gatewayv1.LocalObjectReference) bool

IsLocalSecret checks if the given LocalObjectReference references a Secret resource.

func IsSecret

func IsSecret(secret gatewayv1.SecretObjectReference) bool

IsSecret checks if the given SecretObjectReference references a Secret resource.

func IsService

IsService checks if the given BackendObjectReference references a Service resource.

func MatchesControllerName

func MatchesControllerName[T ~string](v T) bool

MatchesControllerName checks if the given string matches the name of our gateway controller.

func NamespaceDerefOr

func NamespaceDerefOr(ns *gatewayv1.Namespace, defaultNamespace string) string

NamespaceDerefOr attempts to dereference the given Namespace if it is present, otherwise the provided default value will be returned.

Types

This section is empty.

Directories

Path Synopsis
Package caddy .
Package caddy .
Package routechecks .
Package routechecks .

Jump to

Keyboard shortcuts

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