fgw

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package fgw contains types for the gateway route

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend added in v1.4.0

type Backend struct {
	CommonResource `json:",inline"`
	Spec           BackendSpec `json:"spec"`
	Port           int32       `json:"-"` // store the port for the backend temporarily
}

func NewBackend added in v1.4.0

func NewBackend(svcPortName string, targets []BackendTarget) *Backend

type BackendLBPolicy added in v1.4.0

type BackendLBPolicy struct {
	CommonResource `json:",inline"`
	Spec           BackendLBPolicySpec `json:"spec"`
}

func (*BackendLBPolicy) AddTargetRef added in v1.4.0

func (p *BackendLBPolicy) AddTargetRef(ref BackendRef)

type BackendLBPolicySpec added in v1.4.0

type BackendLBPolicySpec struct {
	TargetRefs         []BackendRef                        `json:"targetRefs" copier:"-" hash:"set"`
	SessionPersistence *gwv1.SessionPersistence            `json:"sessionPersistence,omitempty"`
	Algorithm          *gwpav1alpha2.LoadBalancerAlgorithm `json:"algorithm,omitempty"`
}

type BackendRef added in v1.4.0

type BackendRef struct {
	Kind   string `json:"kind"`
	Name   string `json:"name"`
	Weight *int32 `json:"weight,omitempty"`
}

func NewBackendRef added in v1.4.0

func NewBackendRef(name string) BackendRef

func NewBackendRefWithWeight added in v1.4.0

func NewBackendRefWithWeight(name string, weight *int32) BackendRef

type BackendSpec added in v1.4.0

type BackendSpec struct {
	Targets []BackendTarget `json:"targets,omitempty" hash:"set"`
}

type BackendTLSPolicy added in v1.4.0

type BackendTLSPolicy struct {
	CommonResource `json:",inline"`
	Spec           BackendTLSPolicySpec `json:"spec"`
}

func (*BackendTLSPolicy) AddTargetRef added in v1.4.0

func (p *BackendTLSPolicy) AddTargetRef(ref BackendRef)

type BackendTLSPolicySpec added in v1.4.0

type BackendTLSPolicySpec struct {
	TargetRefs []BackendRef               `json:"targetRefs" copier:"-" hash:"set"`
	Validation BackendTLSPolicyValidation `json:"validation"`
}

type BackendTLSPolicyValidation added in v1.4.0

type BackendTLSPolicyValidation struct {
	CACertificates          []map[string]string                     `json:"caCertificates,omitempty" copier:"-" hash:"set"`
	WellKnownCACertificates *gwv1alpha3.WellKnownCACertificatesType `json:"wellKnownCACertificates,omitempty"`
	Hostname                gwv1.PreciseHostname                    `json:"hostname"`
}

type BackendTarget added in v1.4.0

type BackendTarget struct {
	Address string            `json:"address"`
	Port    *int32            `json:"port"`
	Weight  *int32            `json:"weight,omitempty"`
	Tags    map[string]string `json:"tags,omitempty"`
}

type CircuitBreakerSpec added in v1.4.0

type CircuitBreakerSpec struct {
	LatencyThresholdInMilliseconds *int64                              `json:"latencyThreshold,omitempty"`
	ErrorCountThreshold            *int32                              `json:"errorCountThreshold,omitempty"`
	ErrorRatioThreshold            *float32                            `json:"errorRatioThreshold,omitempty"`
	ConcurrencyThreshold           *int32                              `json:"concurrencyThreshold,omitempty"`
	CheckIntervalInMilliseconds    *int64                              `json:"checkInterval,omitempty"`
	BreakIntervalInMilliseconds    *int64                              `json:"breakInterval,omitempty"`
	CircuitBreakerResponse         *extv1alpha1.CircuitBreakerResponse `json:"response,omitempty"`
}

func (*CircuitBreakerSpec) BreakInterval added in v1.4.0

func (c *CircuitBreakerSpec) BreakInterval(breakInterval *metav1.Duration)

func (*CircuitBreakerSpec) CheckInterval added in v1.4.0

func (c *CircuitBreakerSpec) CheckInterval(checkInterval *metav1.Duration)

func (*CircuitBreakerSpec) LatencyThreshold added in v1.4.0

func (c *CircuitBreakerSpec) LatencyThreshold(latencyThreshold *metav1.Duration)

type CommonResource added in v1.4.0

type CommonResource struct {
	Kind       string     `json:"kind"`
	ObjectMeta ObjectMeta `json:"metadata"`
}

func (*CommonResource) GetKind added in v1.4.0

func (r *CommonResource) GetKind() string

func (*CommonResource) GetName added in v1.4.0

func (r *CommonResource) GetName() string

func (*CommonResource) GetNamespace added in v1.4.0

func (r *CommonResource) GetNamespace() string

type CommonRouteSpec added in v1.4.0

type CommonRouteSpec struct {
	ParentRefs []gwv1.ParentReference `json:"parentRefs,omitempty" hash:"set"`
}

type Config added in v1.4.0

type Config interface {
	GetVersion() string
	GetResources() []Resource
	GetSecrets() map[string]string
	GetFilters() map[extv1alpha1.FilterProtocol]map[extv1alpha1.FilterType]string
}

Config is the configuration for the gateway

type ConfigSpec

type ConfigSpec struct {
	Resources []Resource                                                       `json:"resources" hash:"set"`
	Secrets   map[string]string                                                `json:"secrets"`
	Filters   map[extv1alpha1.FilterProtocol]map[extv1alpha1.FilterType]string `json:"filters"`
	Version   string                                                           `json:"version" hash:"ignore"`
}

func (*ConfigSpec) GetFilters added in v1.4.0

func (*ConfigSpec) GetResources added in v1.4.0

func (c *ConfigSpec) GetResources() []Resource

func (*ConfigSpec) GetSecrets added in v1.4.0

func (c *ConfigSpec) GetSecrets() map[string]string

func (*ConfigSpec) GetVersion added in v1.4.0

func (c *ConfigSpec) GetVersion() string

type FaultInjectionDelay

type FaultInjectionDelay struct {
	Percentage        int32  `json:"percentage"`
	MinInMilliseconds *int64 `json:"min,omitempty"`
	MaxInMilliseconds *int64 `json:"max,omitempty"`
}

func (*FaultInjectionDelay) Max added in v1.4.0

func (f *FaultInjectionDelay) Max(max *metav1.Duration)

func (*FaultInjectionDelay) Min added in v1.4.0

func (f *FaultInjectionDelay) Min(min *metav1.Duration)

type FaultInjectionSpec added in v1.4.0

type FaultInjectionSpec struct {
	Delay *FaultInjectionDelay             `json:"delay,omitempty"`
	Abort *extv1alpha1.FaultInjectionAbort `json:"abort,omitempty"`
}

type FrontendTLSValidation added in v1.4.0

type FrontendTLSValidation struct {
	CACertificates []map[string]string `json:"caCertificates,omitempty" copier:"-" hash:"set"`
}

type GRPCBackendRef added in v1.4.0

type GRPCBackendRef struct {
	Kind    string            `json:"kind"`
	Name    string            `json:"name"`
	Weight  *int32            `json:"weight,omitempty"`
	Filters []GRPCRouteFilter `json:"filters,omitempty" hash:"set"`
}

func NewGRPCBackendRef added in v1.4.0

func NewGRPCBackendRef(name string, weight *int32) GRPCBackendRef

type GRPCRoute added in v1.4.0

type GRPCRoute struct {
	CommonResource `json:",inline"`
	Spec           GRPCRouteSpec `json:"spec,omitempty"`
}

type GRPCRouteFilter

type GRPCRouteFilter struct {
	Type                   gwv1.GRPCRouteFilterType `json:"type"`
	RequestHeaderModifier  *gwv1.HTTPHeaderFilter   `json:"requestHeaderModifier,omitempty"`
	ResponseHeaderModifier *gwv1.HTTPHeaderFilter   `json:"responseHeaderModifier,omitempty"`
	RequestMirror          *HTTPRequestMirrorFilter `json:"requestMirror,omitempty"`
	ExtensionConfig        map[string]interface{}   `json:"-"`
	Key                    string                   `json:"key,omitempty"`
}

func (GRPCRouteFilter) MarshalJSON added in v1.4.0

func (f GRPCRouteFilter) MarshalJSON() ([]byte, error)

type GRPCRouteRule added in v1.4.0

type GRPCRouteRule struct {
	Matches            []gwv1.GRPCRouteMatch    `json:"matches,omitempty" hash:"set"`
	Filters            []GRPCRouteFilter        `json:"filters,omitempty" hash:"set"`
	BackendRefs        []GRPCBackendRef         `json:"backendRefs,omitempty" copier:"-" hash:"set"`
	SessionPersistence *gwv1.SessionPersistence `json:"sessionPersistence,omitempty"`
}

type GRPCRouteSpec added in v1.4.0

type GRPCRouteSpec struct {
	CommonRouteSpec `json:",inline"`
	Hostnames       []gwv1.Hostname `json:"hostnames,omitempty" hash:"set"`
	Rules           []GRPCRouteRule `json:"rules,omitempty" copier:"-" hash:"set"`
}

type Gateway added in v1.4.0

type Gateway struct {
	CommonResource `json:",inline"`
	Spec           GatewaySpec `json:"spec"`
}

type GatewaySpec added in v1.4.0

type GatewaySpec struct {
	GatewayClassName gwv1.ObjectName       `json:"gatewayClassName"`
	Listeners        []Listener            `json:"listeners,omitempty" copier:"-" hash:"set"`
	Addresses        []gwv1.GatewayAddress `json:"addresses,omitempty"`
}

type GatewayTLSConfig added in v1.4.0

type GatewayTLSConfig struct {
	Mode               *gwv1.TLSModeType                           `json:"mode,omitempty"`
	Certificates       []map[string]string                         `json:"certificates,omitempty" copier:"-" hash:"set"`
	FrontendValidation *FrontendTLSValidation                      `json:"frontendValidation,omitempty" copier:"-"`
	Options            map[gwv1.AnnotationKey]gwv1.AnnotationValue `json:"options,omitempty"`
}

type HTTPBackendRef added in v1.4.0

type HTTPBackendRef struct {
	Kind    string            `json:"kind"`
	Name    string            `json:"name"`
	Weight  *int32            `json:"weight,omitempty"`
	Filters []HTTPRouteFilter `json:"filters,omitempty" hash:"set"`
}

func NewHTTPBackendRef added in v1.4.0

func NewHTTPBackendRef(name string, weight *int32) HTTPBackendRef

type HTTPLogBatch added in v1.4.0

type HTTPLogBatch struct {
	Size                   *int32  `json:"size,omitempty"`
	IntervalInMilliseconds *int64  `json:"interval,omitempty"`
	Prefix                 *string `json:"prefix,omitempty"`
	Postfix                *string `json:"postfix,omitempty"`
	Separator              *string `json:"separator,omitempty"`
}

func (*HTTPLogBatch) Interval added in v1.4.0

func (b *HTTPLogBatch) Interval(interval *metav1.Duration)

type HTTPLogSpec added in v1.4.0

type HTTPLogSpec struct {
	Target      string            `json:"target"`
	Method      *string           `json:"method,omitempty"`
	Headers     map[string]string `json:"headers,omitempty"`
	BufferLimit *int64            `json:"bufferLimit,omitempty"`
	Batch       *HTTPLogBatch     `json:"batch,omitempty"`
}

type HTTPRequestMirrorFilter

type HTTPRequestMirrorFilter struct {
	BackendRef BackendRef `json:"backendRef"`
}

type HTTPRoute added in v1.4.0

type HTTPRoute struct {
	CommonResource `json:",inline"`
	Spec           HTTPRouteSpec `json:"spec"`
}

type HTTPRouteFilter

type HTTPRouteFilter struct {
	Type                   gwv1.HTTPRouteFilterType        `json:"type"`
	RequestHeaderModifier  *gwv1.HTTPHeaderFilter          `json:"requestHeaderModifier,omitempty"`
	ResponseHeaderModifier *gwv1.HTTPHeaderFilter          `json:"responseHeaderModifier,omitempty"`
	RequestMirror          *HTTPRequestMirrorFilter        `json:"requestMirror,omitempty"`
	RequestRedirect        *gwv1.HTTPRequestRedirectFilter `json:"requestRedirect,omitempty"`
	URLRewrite             *gwv1.HTTPURLRewriteFilter      `json:"urlRewrite,omitempty"`
	ExtensionConfig        map[string]interface{}          `json:"-"`
	Key                    string                          `json:"key,omitempty"`
}

func (HTTPRouteFilter) MarshalJSON added in v1.4.0

func (f HTTPRouteFilter) MarshalJSON() ([]byte, error)

type HTTPRouteRule added in v1.4.0

type HTTPRouteRule struct {
	Matches            []gwv1.HTTPRouteMatch    `json:"matches,omitempty" hash:"set"`
	Filters            []HTTPRouteFilter        `json:"filters,omitempty" hash:"set"`
	BackendRefs        []HTTPBackendRef         `json:"backendRefs,omitempty" copier:"-" hash:"set"`
	Timeouts           *gwv1.HTTPRouteTimeouts  `json:"timeouts,omitempty"`
	SessionPersistence *gwv1.SessionPersistence `json:"sessionPersistence,omitempty"`
}

type HTTPRouteSpec added in v1.4.0

type HTTPRouteSpec struct {
	CommonRouteSpec `json:",inline"`
	Hostnames       []gwv1.Hostname `json:"hostnames,omitempty" hash:"set"`
	Rules           []HTTPRouteRule `json:"rules,omitempty" copier:"-" hash:"set"`
}

type HealthCheckConfig added in v1.4.2

type HealthCheckConfig struct {
	IntervalInSeconds    float64                         `json:"interval"`
	MaxFails             int32                           `json:"maxFails"`
	FailTimeoutInSeconds *float64                        `json:"failTimeout,omitempty"`
	Path                 *string                         `json:"path,omitempty"`
	Matches              []gwpav1alpha2.HealthCheckMatch `json:"matches,omitempty"`
}

func (*HealthCheckConfig) FailTimeout added in v1.4.2

func (c *HealthCheckConfig) FailTimeout(failTimeout *metav1.Duration)

func (*HealthCheckConfig) Interval added in v1.4.2

func (c *HealthCheckConfig) Interval(interval metav1.Duration)

type HealthCheckPolicy added in v1.4.0

type HealthCheckPolicy struct {
	CommonResource `json:",inline"`
	Spec           HealthCheckPolicySpec `json:"spec"`
}

func (*HealthCheckPolicy) AddPort added in v1.4.0

func (*HealthCheckPolicy) AddTargetRef added in v1.4.0

func (p *HealthCheckPolicy) AddTargetRef(ref BackendRef)

type HealthCheckPolicySpec added in v1.4.0

type HealthCheckPolicySpec struct {
	TargetRefs         []BackendRef       `json:"targetRefs" copier:"-" hash:"set"`
	Ports              []PortHealthCheck  `json:"ports,omitempty" copier:"-" hash:"set"`
	DefaultHealthCheck *HealthCheckConfig `json:"healthCheck,omitempty"`
}

type Listener

type Listener struct {
	Name         gwv1.SectionName  `json:"name"`
	Hostname     *gwv1.Hostname    `json:"hostname,omitempty"`
	Port         gwv1.PortNumber   `json:"port"`
	Protocol     gwv1.ProtocolType `json:"protocol"`
	TLS          *GatewayTLSConfig `json:"tls,omitempty" copier:"-"`
	Filters      []ListenerFilter  `json:"filters,omitempty" hash:"set" copier:"-"`
	RouteFilters []ListenerFilter  `json:"routeFilters,omitempty" hash:"set" copier:"-"`
}

type ListenerFilter added in v1.4.0

type ListenerFilter struct {
	Type            extv1alpha1.FilterType `json:"type"`
	ExtensionConfig map[string]interface{} `json:"-"`
	Key             string                 `json:"key,omitempty"`
}

func (ListenerFilter) MarshalJSON added in v1.4.0

func (f ListenerFilter) MarshalJSON() ([]byte, error)

type MetricsSpec added in v1.4.0

type MetricsSpec struct {
	SampleIntervalInMilliseconds *int64 `json:"sampleInterval,omitempty"`
}

func (*MetricsSpec) SampleInterval added in v1.4.0

func (m *MetricsSpec) SampleInterval(sampleInterval *metav1.Duration)

type ObjectMeta added in v1.4.0

type ObjectMeta struct {
	Namespace string `json:"namespace,omitempty"`
	Name      string `json:"name"`
}

type PortHealthCheck added in v1.4.2

type PortHealthCheck struct {
	Port        gwv1.PortNumber    `json:"port"`
	HealthCheck *HealthCheckConfig `json:"healthCheck,omitempty"`
}

type PortRetry added in v1.4.2

type PortRetry struct {
	Port  gwv1.PortNumber `json:"port"`
	Retry *RetryConfig    `json:"retry,omitempty"`
}

type RateLimitSpec added in v1.4.0

type RateLimitSpec struct {
	Burst                  *int32                         `json:"burst,omitempty"`
	Requests               *int32                         `json:"requests,omitempty"`
	IntervalInMilliseconds *int64                         `json:"interval,omitempty"`
	Backlog                *int32                         `json:"backlog,omitempty"`
	RateLimitResponse      *extv1alpha1.RateLimitResponse `json:"response,omitempty"`
}

func (*RateLimitSpec) Interval added in v1.4.0

func (r *RateLimitSpec) Interval(interval *metav1.Duration)

type Resource added in v1.4.0

type Resource interface {
	GetKind() string
	GetNamespace() string
	GetName() string
}

type RetryConfig added in v1.4.2

type RetryConfig struct {
	RetryOn                      []string `json:"retryOn,omitempty"`
	NumRetries                   *int32   `json:"numRetries,omitempty"`
	BackoffBaseIntervalInSeconds *float64 `json:"backoffBaseInterval,omitempty"`
}

func (*RetryConfig) BackoffBaseInterval added in v1.4.2

func (c *RetryConfig) BackoffBaseInterval(backoffBaseInterval *metav1.Duration)

type RetryPolicy added in v1.4.0

type RetryPolicy struct {
	CommonResource `json:",inline"`
	Spec           RetryPolicySpec `json:"spec"`
}

func (*RetryPolicy) AddPort added in v1.4.0

func (p *RetryPolicy) AddPort(port gwpav1alpha2.PortRetry)

func (*RetryPolicy) AddTargetRef added in v1.4.0

func (p *RetryPolicy) AddTargetRef(ref BackendRef)

type RetryPolicySpec added in v1.4.0

type RetryPolicySpec struct {
	TargetRefs   []BackendRef `json:"targetRefs" copier:"-" hash:"set"`
	Ports        []PortRetry  `json:"ports,omitempty" hash:"set"`
	DefaultRetry *RetryConfig `json:"retry,omitempty"`
}

type ServicePortName

type ServicePortName struct {
	types.NamespacedName
	SectionName string
	Port        *int32
}

ServicePortName is a combination of a service name, namespace, and port

func (*ServicePortName) String

func (spn *ServicePortName) String() string

type TCPRoute added in v1.4.0

type TCPRoute struct {
	CommonResource `json:",inline"`
	Spec           TCPRouteSpec `json:"spec"`
}

type TCPRouteRule

type TCPRouteRule struct {
	BackendRefs []BackendRef `json:"backendRefs,omitempty" copier:"-" hash:"set"`
}

type TCPRouteSpec added in v1.4.0

type TCPRouteSpec struct {
	CommonRouteSpec `json:",inline"`
	Rules           []TCPRouteRule `json:"rules" copier:"-" hash:"set"`
}

TCPRouteSpec defines the desired state of TCPRoute

type TLSRoute added in v1.4.0

type TLSRoute struct {
	CommonResource `json:",inline"`
	Spec           TLSRouteSpec `json:"spec"`
}

type TLSRouteRule added in v1.4.0

type TLSRouteRule struct {
	BackendRefs []BackendRef `json:"backendRefs,omitempty" hash:"set"`
}

type TLSRouteSpec added in v1.4.0

type TLSRouteSpec struct {
	CommonRouteSpec `json:",inline"`
	Hostnames       []gwv1alpha2.Hostname `json:"hostnames,omitempty" hash:"set"`
	Rules           []TLSRouteRule        `json:"rules" copier:"-" hash:"set"`
}

TLSRouteSpec defines the desired state of a TLSRoute resource.

type UDPRoute added in v1.4.0

type UDPRoute struct {
	CommonResource `json:",inline"`
	Spec           UDPRouteSpec `json:"spec"`
}

type UDPRouteRule

type UDPRouteRule struct {
	BackendRefs []BackendRef `json:"backendRefs,omitempty" copier:"-" hash:"set"`
}

type UDPRouteSpec added in v1.4.0

type UDPRouteSpec struct {
	CommonRouteSpec `json:",inline"`
	Rules           []UDPRouteRule `json:"rules" copier:"-" hash:"set"`
}

Jump to

Keyboard shortcuts

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