v1alpha1

package
v1.2.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 is the v1alpha3 version of the API.

Package v1alpha1 contains API Schema definitions for the gateway.flomesh.io v1alpha1 API group

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register MeshConfig
	SchemeGroupVersion = schema.GroupVersion{
		Group:   "gateway.flomesh.io",
		Version: "v1alpha1",
	}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme adds all Resources to the Scheme
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type GRPCRateLimit

type GRPCRateLimit struct {
	Match     gwv1alpha2.GRPCRouteMatch `json:"match"`
	RateLimit *L7RateLimit              `json:"rateLimit,omitempty"`
}

GRPCRateLimit defines the rate limit configuration for a GRPC route

func (*GRPCRateLimit) DeepCopy

func (in *GRPCRateLimit) DeepCopy() *GRPCRateLimit

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

func (*GRPCRateLimit) DeepCopyInto

func (in *GRPCRateLimit) DeepCopyInto(out *GRPCRateLimit)

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

type HTTPRateLimit

type HTTPRateLimit struct {
	Match     gwv1beta1.HTTPRouteMatch `json:"match"`
	RateLimit *L7RateLimit             `json:"rateLimit,omitempty"`
}

HTTPRateLimit defines the rate limit configuration for a HTTP route

func (*HTTPRateLimit) DeepCopy

func (in *HTTPRateLimit) DeepCopy() *HTTPRateLimit

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

func (*HTTPRateLimit) DeepCopyInto

func (in *HTTPRateLimit) DeepCopyInto(out *HTTPRateLimit)

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

type HostnameRateLimit

type HostnameRateLimit struct {
	Hostname  gwv1beta1.Hostname `json:"hostname"`
	RateLimit *L7RateLimit       `json:"rateLimit,omitempty"`
}

HostnameRateLimit defines the rate limit configuration for a hostname

func (*HostnameRateLimit) DeepCopy

func (in *HostnameRateLimit) DeepCopy() *HostnameRateLimit

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

func (*HostnameRateLimit) DeepCopyInto

func (in *HostnameRateLimit) DeepCopyInto(out *HostnameRateLimit)

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

type L7RateLimit

type L7RateLimit struct {
	// +optional
	// +kubebuilder:default=Local
	// +kubebuilder:validation:Enum=Local;Global
	// Mode is the mode of the rate limit policy, Local or Global, default is Local
	Mode *RateLimitPolicyMode `json:"mode"`

	// +optional
	// +kubebuilder:default=10
	// Backlog is the number of requests allowed to wait in the queue
	Backlog *int `json:"backlog,omitempty"`

	// Requests is the number of requests allowed per statTimeWindow
	Requests int `json:"requests"`

	// Burst is the number of requests allowed to be bursted, if not specified, it will be the same as Requests
	// +optional
	Burst *int `json:"burst,omitempty"`

	// StatTimeWindow is the time window in seconds
	StatTimeWindow int `json:"statTimeWindow"`

	// ResponseStatusCode is the response status code to be returned when the rate limit is exceeded
	// +optional
	// +kubebuilder:default=429
	ResponseStatusCode *int `json:"responseStatusCode"`

	// +optional
	// ResponseHeadersToAdd is the response headers to be added when the rate limit is exceeded
	ResponseHeadersToAdd map[string]string `json:"responseHeadersToAdd,omitempty"`
}

L7RateLimit defines the rate limit configuration for a route

func (*L7RateLimit) DeepCopy

func (in *L7RateLimit) DeepCopy() *L7RateLimit

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

func (*L7RateLimit) DeepCopyInto

func (in *L7RateLimit) DeepCopyInto(out *L7RateLimit)

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

type PortRateLimit

type PortRateLimit struct {
	Port gwv1beta1.PortNumber `json:"port"`
	BPS  *int64               `json:"bps,omitempty"`
}

PortRateLimit defines the rate limit configuration for a port

func (*PortRateLimit) DeepCopy

func (in *PortRateLimit) DeepCopy() *PortRateLimit

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

func (*PortRateLimit) DeepCopyInto

func (in *PortRateLimit) DeepCopyInto(out *PortRateLimit)

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

type RateLimitPolicy

type RateLimitPolicy struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   RateLimitPolicySpec   `json:"spec,omitempty"`
	Status RateLimitPolicyStatus `json:"status,omitempty"`
}

RateLimitPolicy is the Schema for the RateLimitPolicys API

func (*RateLimitPolicy) DeepCopy

func (in *RateLimitPolicy) DeepCopy() *RateLimitPolicy

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

func (*RateLimitPolicy) DeepCopyInto

func (in *RateLimitPolicy) DeepCopyInto(out *RateLimitPolicy)

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

func (*RateLimitPolicy) DeepCopyObject

func (in *RateLimitPolicy) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RateLimitPolicyList

type RateLimitPolicyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []RateLimitPolicy `json:"items"`
}

RateLimitPolicyList contains a list of RateLimitPolicy

func (*RateLimitPolicyList) DeepCopy

func (in *RateLimitPolicyList) DeepCopy() *RateLimitPolicyList

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

func (*RateLimitPolicyList) DeepCopyInto

func (in *RateLimitPolicyList) DeepCopyInto(out *RateLimitPolicyList)

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

func (*RateLimitPolicyList) DeepCopyObject

func (in *RateLimitPolicyList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RateLimitPolicyMode

type RateLimitPolicyMode string
const (
	// RateLimitPolicyModeLocal is the local mode
	RateLimitPolicyModeLocal RateLimitPolicyMode = "Local"

	// RateLimitPolicyModeGlobal is the global mode
	RateLimitPolicyModeGlobal RateLimitPolicyMode = "Global"
)

type RateLimitPolicySpec

type RateLimitPolicySpec struct {
	// TargetRef is the reference to the target resource to which the policy is applied
	TargetRef gwv1alpha2.PolicyTargetReference `json:"targetRef"`

	// +optional
	// Ports is the rate limit configuration for ports
	Ports []PortRateLimit `json:"ports,omitempty"`

	// +optional
	// DefaultBPS is the default rate limit for all ports
	DefaultBPS *int64 `json:"bps,omitempty"`

	// +optional
	// Hostnames is the rate limit configuration for hostnames
	Hostnames []HostnameRateLimit `json:"hostnames,omitempty"`

	// +optional
	// HTTPRateLimits is the rate limit configuration for HTTP routes
	HTTPRateLimits []HTTPRateLimit `json:"http,omitempty"`

	// +optional
	// GRPCRateLimits is the rate limit configuration for GRPC routes
	GRPCRateLimits []GRPCRateLimit `json:"grpc,omitempty"`

	// +optional
	// DefaultRateLimit is the default rate limit for all routes and hostnames
	DefaultL7RateLimit *L7RateLimit `json:"rateLimit,omitempty"`
}

RateLimitPolicySpec defines the desired state of RateLimitPolicy

func (*RateLimitPolicySpec) DeepCopy

func (in *RateLimitPolicySpec) DeepCopy() *RateLimitPolicySpec

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

func (*RateLimitPolicySpec) DeepCopyInto

func (in *RateLimitPolicySpec) DeepCopyInto(out *RateLimitPolicySpec)

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

type RateLimitPolicyStatus

type RateLimitPolicyStatus struct {
	// Conditions describe the current conditions of the RateLimitPolicy.
	//
	// +optional
	// +listType=map
	// +listMapKey=type
	// +kubebuilder:validation:MaxItems=8
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

RateLimitPolicyStatus defines the observed state of RateLimitPolicy

func (*RateLimitPolicyStatus) DeepCopy

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

func (*RateLimitPolicyStatus) DeepCopyInto

func (in *RateLimitPolicyStatus) DeepCopyInto(out *RateLimitPolicyStatus)

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

type RouteRateLimitConfig

type RouteRateLimitConfig struct {
	HttpRateLimits   []HTTPRateLimit `json:"http,omitempty"`
	GrpcRateLimits   []GRPCRateLimit `json:"grpc,omitempty"`
	DefaultRateLimit *L7RateLimit    `json:"rateLimit,omitempty"`
}

RouteRateLimitConfig defines the rate limit configuration for routes

func (*RouteRateLimitConfig) DeepCopy

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

func (*RouteRateLimitConfig) DeepCopyInto

func (in *RouteRateLimitConfig) DeepCopyInto(out *RouteRateLimitConfig)

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

Jump to

Keyboard shortcuts

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