Help us shape the future of Go! Take the 2026 Go Developer Survey

resource

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindConfigMap            = "ConfigMap"
	KindClientTrafficPolicy  = "ClientTrafficPolicy"
	KindBackendTrafficPolicy = "BackendTrafficPolicy"
	KindBackendTLSPolicy     = "BackendTLSPolicy"
	KindBackend              = "Backend"
	KindEnvoyPatchPolicy     = "EnvoyPatchPolicy"
	KindEnvoyExtensionPolicy = "EnvoyExtensionPolicy"
	KindSecurityPolicy       = "SecurityPolicy"
	KindEnvoyProxy           = "EnvoyProxy"
	KindGateway              = "Gateway"
	KindGatewayClass         = "GatewayClass"
	KindGRPCRoute            = "GRPCRoute"
	KindHTTPRoute            = "HTTPRoute"
	KindNamespace            = "Namespace"
	KindTLSRoute             = "TLSRoute"
	KindTCPRoute             = "TCPRoute"
	KindUDPRoute             = "UDPRoute"
	KindService              = "Service"
	KindServiceImport        = "ServiceImport"
	KindSecret               = "Secret"
	KindHTTPRouteFilter      = "HTTPRouteFilter"
	KindReferenceGrant       = "ReferenceGrant"
	KindClusterTrustBundle   = "ClusterTrustBundle"
)

Variables

This section is empty.

Functions

func IterYAMLBytes

func IterYAMLBytes(input []byte, handle func([]byte) error) error

IterYAMLBytes iters every valid YAML resource from YAML bytes and process each of them by calling `handle` callback.

Types

type ControllerResources

type ControllerResources []*Resources

ControllerResources holds all the GatewayAPI resources per GatewayClass

func (*ControllerResources) DeepCopy

DeepCopy creates a new ControllerResources. It is handwritten since the tooling was unable to copy into a new slice

func (ControllerResources) Sort added in v1.5.0

func (c ControllerResources) Sort()

type Defaulter added in v1.3.1

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

Defaulter can set default values for crd object according to their schema.

func GetGatewaySchemaDefaulter added in v1.5.0

func GetGatewaySchemaDefaulter() *Defaulter

func (*Defaulter) ApplyDefault added in v1.3.1

ApplyDefault applies default values for input object, and return the object with default values.

type InfraIRMap

type InfraIRMap map[string]*ir.Infra

type Resources

type Resources struct {

	// EnvoyProxyForGatewayClass holds EnvoyProxy attached to GatewayClass
	EnvoyProxyForGatewayClass *egv1a1.EnvoyProxy `json:"envoyProxyForGatewayClass,omitempty" yaml:"envoyProxyForGatewayClass,omitempty"`
	// EnvoyProxiesForGateways holds EnvoyProxiesForGateways attached to Gateways
	EnvoyProxiesForGateways []*egv1a1.EnvoyProxy `json:"envoyProxiesForGateways,omitempty" yaml:"envoyProxiesForGateways,omitempty"`

	GatewayClass            *gwapiv1.GatewayClass          `json:"gatewayClass,omitempty" yaml:"gatewayClass,omitempty"`
	Gateways                []*gwapiv1.Gateway             `json:"gateways,omitempty" yaml:"gateways,omitempty"`
	HTTPRoutes              []*gwapiv1.HTTPRoute           `json:"httpRoutes,omitempty" yaml:"httpRoutes,omitempty"`
	GRPCRoutes              []*gwapiv1.GRPCRoute           `json:"grpcRoutes,omitempty" yaml:"grpcRoutes,omitempty"`
	TLSRoutes               []*gwapiv1a2.TLSRoute          `json:"tlsRoutes,omitempty" yaml:"tlsRoutes,omitempty"`
	TCPRoutes               []*gwapiv1a2.TCPRoute          `json:"tcpRoutes,omitempty" yaml:"tcpRoutes,omitempty"`
	UDPRoutes               []*gwapiv1a2.UDPRoute          `json:"udpRoutes,omitempty" yaml:"udpRoutes,omitempty"`
	ReferenceGrants         []*gwapiv1b1.ReferenceGrant    `json:"referenceGrants,omitempty" yaml:"referenceGrants,omitempty"`
	Namespaces              []*corev1.Namespace            `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`
	Services                []*corev1.Service              `json:"services,omitempty" yaml:"services,omitempty"`
	ServiceImports          []*mcsapiv1a1.ServiceImport    `json:"serviceImports,omitempty" yaml:"serviceImports,omitempty"`
	EndpointSlices          []*discoveryv1.EndpointSlice   `json:"endpointSlices,omitempty" yaml:"endpointSlices,omitempty"`
	Secrets                 []*corev1.Secret               `json:"secrets,omitempty" yaml:"secrets,omitempty"`
	ConfigMaps              []*corev1.ConfigMap            `json:"configMaps,omitempty" yaml:"configMaps,omitempty"`
	ExtensionRefFilters     []unstructured.Unstructured    `json:"extensionRefFilters,omitempty" yaml:"extensionRefFilters,omitempty"`
	EnvoyPatchPolicies      []*egv1a1.EnvoyPatchPolicy     `json:"envoyPatchPolicies,omitempty" yaml:"envoyPatchPolicies,omitempty"`
	ClientTrafficPolicies   []*egv1a1.ClientTrafficPolicy  `json:"clientTrafficPolicies,omitempty" yaml:"clientTrafficPolicies,omitempty"`
	BackendTrafficPolicies  []*egv1a1.BackendTrafficPolicy `json:"backendTrafficPolicies,omitempty" yaml:"backendTrafficPolicies,omitempty"`
	SecurityPolicies        []*egv1a1.SecurityPolicy       `json:"securityPolicies,omitempty" yaml:"securityPolicies,omitempty"`
	BackendTLSPolicies      []*gwapiv1a3.BackendTLSPolicy  `json:"backendTLSPolicies,omitempty" yaml:"backendTLSPolicies,omitempty"`
	EnvoyExtensionPolicies  []*egv1a1.EnvoyExtensionPolicy `json:"envoyExtensionPolicies,omitempty" yaml:"envoyExtensionPolicies,omitempty"`
	ExtensionServerPolicies []unstructured.Unstructured    `json:"extensionServerPolicies,omitempty" yaml:"extensionServerPolicies,omitempty"`
	Backends                []*egv1a1.Backend              `json:"backends,omitempty" yaml:"backends,omitempty"`
	HTTPRouteFilters        []*egv1a1.HTTPRouteFilter      `json:"httpFilters,omitempty" yaml:"httpFilters,omitempty"`

	ClusterTrustBundles []*certificatesv1b1.ClusterTrustBundle `json:"clusterTrustBundles,omitempty" yaml:"clusterTrustBundles,omitempty"`
}

Resources holds the Gateway API and related resources that the translators needs as inputs. +k8s:deepcopy-gen=true

func LoadResourcesFromYAMLBytes

func LoadResourcesFromYAMLBytes(yamlBytes []byte, addMissingResources bool) (*Resources, error)

LoadResourcesFromYAMLBytes will load Resources from given Kubernetes YAML string. TODO: This function should be able to process arbitrary number of resources, tracked by https://github.com/envoyproxy/gateway/issues/3207.

func NewResources

func NewResources() *Resources

func (*Resources) DeepCopy

func (in *Resources) DeepCopy() *Resources

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resources.

func (*Resources) DeepCopyInto

func (in *Resources) DeepCopyInto(out *Resources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Resources) GetBackend

func (r *Resources) GetBackend(namespace, name string) *egv1a1.Backend

func (*Resources) GetClusterTrustBundle added in v1.5.0

func (r *Resources) GetClusterTrustBundle(name string) *certificatesv1b1.ClusterTrustBundle

func (*Resources) GetConfigMap

func (r *Resources) GetConfigMap(namespace, name string) *corev1.ConfigMap

func (*Resources) GetEndpointSlicesForBackend

func (r *Resources) GetEndpointSlicesForBackend(svcNamespace, svcName, backendKind string) []*discoveryv1.EndpointSlice

func (*Resources) GetEnvoyProxy

func (r *Resources) GetEnvoyProxy(namespace, name string) *egv1a1.EnvoyProxy

func (*Resources) GetNamespace

func (r *Resources) GetNamespace(name string) *corev1.Namespace

func (*Resources) GetSecret

func (r *Resources) GetSecret(namespace, name string) *corev1.Secret

func (*Resources) GetService

func (r *Resources) GetService(namespace, name string) *corev1.Service

GetService returns the Service with the given namespace and name.

func (*Resources) GetServiceByLabels added in v1.5.0

func (r *Resources) GetServiceByLabels(labels map[string]string, namespace string) *corev1.Service

GetServiceByLabels returns the Service matching the given labels and namespace target.

func (*Resources) GetServiceImport

func (r *Resources) GetServiceImport(namespace, name string) *mcsapiv1a1.ServiceImport

func (*Resources) Sort added in v1.5.0

func (r *Resources) Sort()

type Validator

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

Validator is a local/offline Kubernetes resources validator.

func GetDefaultValidator added in v1.5.0

func GetDefaultValidator() *Validator

func (Validator) Validate

func (v Validator) Validate(content []byte) error

Validate validates one Kubernetes resource.

type XdsIRMap

type XdsIRMap map[string]*ir.Xds

Jump to

Keyboard shortcuts

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