Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group.
Index ¶
- Constants
- Variables
- func Resource(resource string) schema.GroupResource
- type RateLimit
- func (in *RateLimit) DeepCopy() *RateLimit
- func (in *RateLimit) DeepCopyInto(out *RateLimit)
- func (in *RateLimit) DeepCopyObject() runtime.Object
- func (p *RateLimit) GetGroupVersionResource() schema.GroupVersionResource
- func (p *RateLimit) GetObjectMeta() *metav1.ObjectMeta
- func (p *RateLimit) GetSingularName() string
- func (p *RateLimit) GetStatus() resource.StatusSubResource
- func (p *RateLimit) IsStorageVersion() bool
- func (p *RateLimit) NamespaceScoped() bool
- func (p *RateLimit) New() runtime.Object
- func (p *RateLimit) NewList() runtime.Object
- type RateLimitDescriptor
- type RateLimitList
- type RateLimitPhase
- type RateLimitPolicy
- type RateLimitSpec
- type RateLimitStatus
- type RateLimitUnit
Constants ¶
const GroupName = "policy.apoxy.dev"
GroupName specifies the group name used to register the objects.
Variables ¶
var ( // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. SchemeBuilder runtime.SchemeBuilder // Deprecated: use Install instead AddToScheme = localSchemeBuilder.AddToScheme Install = localSchemeBuilder.AddToScheme )
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"}
GroupVersion specifies the group and the version used to register the objects.
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit.
func (*RateLimit) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RateLimit) DeepCopyObject ¶
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 (*RateLimit) GetStatus ¶
func (p *RateLimit) GetStatus() resource.StatusSubResource
func (*RateLimit) IsStorageVersion ¶
func (*RateLimit) NamespaceScoped ¶
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 (ps *RateLimitStatus) CopyTo(parent resource.ObjectWithStatusSubResource)
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" )