v1alpha1

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group.

Index

Constants

View Source
const GroupName = "policy.apoxy.dev"

GroupName specifies the group name used to register the objects.

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// Deprecated: use Install instead
	AddToScheme = localSchemeBuilder.AddToScheme
	Install     = localSchemeBuilder.AddToScheme
)
View Source
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"}

GroupVersion specifies the group and the version used to register the objects.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects Deprecated: use GroupVersion instead.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type RateLimit

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

	Spec   RateLimitSpec   `json:"spec,omitempty"`
	Status RateLimitStatus `json:"status,omitempty"`
}

func (*RateLimit) DeepCopy

func (in *RateLimit) DeepCopy() *RateLimit

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

func (*RateLimit) DeepCopyInto

func (in *RateLimit) DeepCopyInto(out *RateLimit)

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

func (*RateLimit) DeepCopyObject

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

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

func (*RateLimit) GetGroupVersionResource

func (p *RateLimit) GetGroupVersionResource() schema.GroupVersionResource

func (*RateLimit) GetObjectMeta

func (p *RateLimit) GetObjectMeta() *metav1.ObjectMeta

func (*RateLimit) GetSingularName

func (p *RateLimit) GetSingularName() string

func (*RateLimit) GetStatus

func (p *RateLimit) GetStatus() resource.StatusSubResource

func (*RateLimit) IsStorageVersion

func (p *RateLimit) IsStorageVersion() bool

func (*RateLimit) NamespaceScoped

func (p *RateLimit) NamespaceScoped() bool

func (*RateLimit) New

func (p *RateLimit) New() runtime.Object

func (*RateLimit) NewList

func (p *RateLimit) NewList() runtime.Object

type RateLimitDescriptor

type RateLimitDescriptor struct {
	// Key is the key of the descriptor.
	Key string `json:"key,omitempty"`

	// Value is the value of the descriptor.
	// +optional
	Value string `json:"value,omitempty"`

	// RateLimit defines the rate limit policy for the descriptor.
	// +optional
	RateLimit *RateLimitPolicy `json:"rateLimit,omitempty"`

	// Whether descriptor is in "shadow mode" which means that the rate limit
	// is not enforced but the requests are logged.
	ShadowMode bool `json:"shadowMode,omitempty"`
}

func (*RateLimitDescriptor) DeepCopy

func (in *RateLimitDescriptor) DeepCopy() *RateLimitDescriptor

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

func (*RateLimitDescriptor) DeepCopyInto

func (in *RateLimitDescriptor) DeepCopyInto(out *RateLimitDescriptor)

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

type RateLimitList

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

RateLimitList contains a list of RateLimit objects.

func (*RateLimitList) DeepCopy

func (in *RateLimitList) DeepCopy() *RateLimitList

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

func (*RateLimitList) DeepCopyInto

func (in *RateLimitList) DeepCopyInto(out *RateLimitList)

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

func (*RateLimitList) DeepCopyObject

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

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

func (*RateLimitList) GetListMeta

func (pl *RateLimitList) GetListMeta() *metav1.ListMeta

type RateLimitPhase

type RateLimitPhase string

RateLimitPhase is the current state of the rate limit.

const (
	// RateLimitPhasePending is the state when the rate limit is pending.
	RateLimitPhasePending RateLimitPhase = "Pending"

	// RateLimitPhaseActive is the state when the rate limit is active.
	RateLimitPhaseActive RateLimitPhase = "Active"

	// RateLimitPhaseShadow is the state when the rate limit is in shadow mode.
	// In shadow mode, the rate limit is not enforced but the requests are logged.
	RateLimitPhaseShadow RateLimitPhase = "Shadow"
)

type RateLimitPolicy

type RateLimitPolicy struct {
	// Unit of time for the rate limit.
	Unit RateLimitUnit `json:"unit,omitempty"`

	// How many requests are allowed per unit.
	// 0 means no requests are allowed.
	RequestsPerUnit uint32 `json:"requestsPerUnit,omitempty"`

	// Sets unlimited requests per unit.
	// +optional
	Unlimited bool `json:"unlimited,omitempty"`
}

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.

type RateLimitSpec

type RateLimitSpec struct {
	// A list of rate limit descriptors.
	Descriptors []*RateLimitDescriptor `json:"descriptors,omitempty"`
}

func (*RateLimitSpec) DeepCopy

func (in *RateLimitSpec) DeepCopy() *RateLimitSpec

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

func (*RateLimitSpec) DeepCopyInto

func (in *RateLimitSpec) DeepCopyInto(out *RateLimitSpec)

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

type RateLimitStatus

type RateLimitStatus struct {
	// Phase is the current state of the rate limit.
	Phase RateLimitPhase `json:"phase,omitempty"`

	// Number of rate limit requests within the limit.
	WithinLimit int64 `json:"withinLimit,omitempty"`

	// Number of rate limit requests that exceeded the limit.
	OverLimit int64 `json:"overLimit,omitempty"`

	// Total number of rate limit requests.
	TotalRequests int64 `json:"totalRequests,omitempty"`
}

func (*RateLimitStatus) CopyTo

func (*RateLimitStatus) DeepCopy

func (in *RateLimitStatus) DeepCopy() *RateLimitStatus

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

func (*RateLimitStatus) DeepCopyInto

func (in *RateLimitStatus) DeepCopyInto(out *RateLimitStatus)

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

func (*RateLimitStatus) SubResourceName

func (ps *RateLimitStatus) SubResourceName() string

type RateLimitUnit

type RateLimitUnit string
const (
	// RateLimitUnitSecond is the unit of time for the rate limit.
	RateLimitUnitSecond RateLimitUnit = "Second"
	// RateLimitUnitMinute is the unit of time for the rate limit.
	RateLimitUnitMinute RateLimitUnit = "Minute"
	// RateLimitUnitHour is the unit of time for the rate limit.
	RateLimitUnitHour RateLimitUnit = "Hour"
	// RateLimitUnitDay is the unit of time for the rate limit.
	RateLimitUnitDay RateLimitUnit = "Day"
)

Jump to

Keyboard shortcuts

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