Documentation
¶
Index ¶
- Variables
- type ProxyRequest
- type WatchAggregator
- type WatchParams
- func (*WatchParams) Descriptor() ([]byte, []int)deprecated
- func (x *WatchParams) GetAllowWatchBookmarks() bool
- func (x *WatchParams) GetFieldSelector() string
- func (x *WatchParams) GetGroup() string
- func (x *WatchParams) GetLabelSelector() string
- func (x *WatchParams) GetNamespace() string
- func (x *WatchParams) GetResource() string
- func (x *WatchParams) GetResourceVersion() string
- func (x *WatchParams) GetSendInitialEvents() bool
- func (x *WatchParams) GetVersion() string
- func (*WatchParams) ProtoMessage()
- func (x *WatchParams) ProtoReflect() protoreflect.Message
- func (x *WatchParams) Reset()
- func (x *WatchParams) String() string
- func (m *WatchParams) Validate() error
- func (m *WatchParams) ValidateAll() error
- type WatchParamsMultiError
- type WatchParamsValidationError
- func (e WatchParamsValidationError) Cause() error
- func (e WatchParamsValidationError) Error() string
- func (e WatchParamsValidationError) ErrorName() string
- func (e WatchParamsValidationError) Field() string
- func (e WatchParamsValidationError) Key() bool
- func (e WatchParamsValidationError) Reason() string
- type WatchRequest
- func (*WatchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *WatchRequest) GetType() string
- func (x *WatchRequest) GetWatchId() string
- func (x *WatchRequest) GetWatchParams() *WatchParams
- func (*WatchRequest) ProtoMessage()
- func (x *WatchRequest) ProtoReflect() protoreflect.Message
- func (x *WatchRequest) Reset()
- func (x *WatchRequest) String() string
- func (m *WatchRequest) Validate() error
- func (m *WatchRequest) ValidateAll() error
- type WatchRequestMultiError
- type WatchRequestValidationError
- func (e WatchRequestValidationError) Cause() error
- func (e WatchRequestValidationError) Error() string
- func (e WatchRequestValidationError) ErrorName() string
- func (e WatchRequestValidationError) Field() string
- func (e WatchRequestValidationError) Key() bool
- func (e WatchRequestValidationError) Reason() string
- type WebSocketAcceptFunc
- type WebSocketInterface
Constants ¶
This section is empty.
Variables ¶
var File_internal_module_kubernetes_api_server_watch_aggregator_watch_aggregator_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type ProxyRequest ¶
type WatchAggregator ¶
type WatchAggregator struct {
// contains filtered or unexported fields
}
func NewWatchAggregator ¶
func NewWatchAggregator(log *slog.Logger, api modshared.API, accept WebSocketAcceptFunc, proxyRequest ProxyRequest) *WatchAggregator
func (*WatchAggregator) Handle ¶
func (a *WatchAggregator) Handle(ctx context.Context)
type WatchParams ¶
type WatchParams struct { Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` Resource string `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` ResourceVersion *string `protobuf:"bytes,5,opt,name=resource_version,json=resourceVersion,proto3,oneof" json:"resource_version,omitempty"` AllowWatchBookmarks *bool `` /* 127-byte string literal not displayed */ SendInitialEvents *bool `protobuf:"varint,7,opt,name=send_initial_events,json=sendInitialEvents,proto3,oneof" json:"send_initial_events,omitempty"` FieldSelector *string `protobuf:"bytes,8,opt,name=field_selector,json=fieldSelector,proto3,oneof" json:"field_selector,omitempty"` LabelSelector *string `protobuf:"bytes,9,opt,name=label_selector,json=labelSelector,proto3,oneof" json:"label_selector,omitempty"` // contains filtered or unexported fields }
func (*WatchParams) Descriptor
deprecated
func (*WatchParams) Descriptor() ([]byte, []int)
Deprecated: Use WatchParams.ProtoReflect.Descriptor instead.
func (*WatchParams) GetAllowWatchBookmarks ¶
func (x *WatchParams) GetAllowWatchBookmarks() bool
func (*WatchParams) GetFieldSelector ¶
func (x *WatchParams) GetFieldSelector() string
func (*WatchParams) GetGroup ¶
func (x *WatchParams) GetGroup() string
func (*WatchParams) GetLabelSelector ¶
func (x *WatchParams) GetLabelSelector() string
func (*WatchParams) GetNamespace ¶
func (x *WatchParams) GetNamespace() string
func (*WatchParams) GetResource ¶
func (x *WatchParams) GetResource() string
func (*WatchParams) GetResourceVersion ¶
func (x *WatchParams) GetResourceVersion() string
func (*WatchParams) GetSendInitialEvents ¶
func (x *WatchParams) GetSendInitialEvents() bool
func (*WatchParams) GetVersion ¶
func (x *WatchParams) GetVersion() string
func (*WatchParams) ProtoMessage ¶
func (*WatchParams) ProtoMessage()
func (*WatchParams) ProtoReflect ¶
func (x *WatchParams) ProtoReflect() protoreflect.Message
func (*WatchParams) Reset ¶
func (x *WatchParams) Reset()
func (*WatchParams) String ¶
func (x *WatchParams) String() string
func (*WatchParams) Validate ¶
func (m *WatchParams) Validate() error
Validate checks the field values on WatchParams with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*WatchParams) ValidateAll ¶
func (m *WatchParams) ValidateAll() error
ValidateAll checks the field values on WatchParams with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in WatchParamsMultiError, or nil if none found.
type WatchParamsMultiError ¶
type WatchParamsMultiError []error
WatchParamsMultiError is an error wrapping multiple validation errors returned by WatchParams.ValidateAll() if the designated constraints aren't met.
func (WatchParamsMultiError) AllErrors ¶
func (m WatchParamsMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (WatchParamsMultiError) Error ¶
func (m WatchParamsMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type WatchParamsValidationError ¶
type WatchParamsValidationError struct {
// contains filtered or unexported fields
}
WatchParamsValidationError is the validation error returned by WatchParams.Validate if the designated constraints aren't met.
func (WatchParamsValidationError) Cause ¶
func (e WatchParamsValidationError) Cause() error
Cause function returns cause value.
func (WatchParamsValidationError) Error ¶
func (e WatchParamsValidationError) Error() string
Error satisfies the builtin error interface
func (WatchParamsValidationError) ErrorName ¶
func (e WatchParamsValidationError) ErrorName() string
ErrorName returns error name.
func (WatchParamsValidationError) Field ¶
func (e WatchParamsValidationError) Field() string
Field function returns field value.
func (WatchParamsValidationError) Key ¶
func (e WatchParamsValidationError) Key() bool
Key function returns key value.
func (WatchParamsValidationError) Reason ¶
func (e WatchParamsValidationError) Reason() string
Reason function returns reason value.
type WatchRequest ¶
type WatchRequest struct { WatchId string `protobuf:"bytes,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` WatchParams *WatchParams `protobuf:"bytes,3,opt,name=watch_params,json=watchParams,proto3,oneof" json:"watch_params,omitempty"` // contains filtered or unexported fields }
func (*WatchRequest) Descriptor
deprecated
func (*WatchRequest) Descriptor() ([]byte, []int)
Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead.
func (*WatchRequest) GetType ¶
func (x *WatchRequest) GetType() string
func (*WatchRequest) GetWatchId ¶
func (x *WatchRequest) GetWatchId() string
func (*WatchRequest) GetWatchParams ¶
func (x *WatchRequest) GetWatchParams() *WatchParams
func (*WatchRequest) ProtoMessage ¶
func (*WatchRequest) ProtoMessage()
func (*WatchRequest) ProtoReflect ¶
func (x *WatchRequest) ProtoReflect() protoreflect.Message
func (*WatchRequest) Reset ¶
func (x *WatchRequest) Reset()
func (*WatchRequest) String ¶
func (x *WatchRequest) String() string
func (*WatchRequest) Validate ¶
func (m *WatchRequest) Validate() error
Validate checks the field values on WatchRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*WatchRequest) ValidateAll ¶
func (m *WatchRequest) ValidateAll() error
ValidateAll checks the field values on WatchRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in WatchRequestMultiError, or nil if none found.
type WatchRequestMultiError ¶
type WatchRequestMultiError []error
WatchRequestMultiError is an error wrapping multiple validation errors returned by WatchRequest.ValidateAll() if the designated constraints aren't met.
func (WatchRequestMultiError) AllErrors ¶
func (m WatchRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (WatchRequestMultiError) Error ¶
func (m WatchRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type WatchRequestValidationError ¶
type WatchRequestValidationError struct {
// contains filtered or unexported fields
}
WatchRequestValidationError is the validation error returned by WatchRequest.Validate if the designated constraints aren't met.
func (WatchRequestValidationError) Cause ¶
func (e WatchRequestValidationError) Cause() error
Cause function returns cause value.
func (WatchRequestValidationError) Error ¶
func (e WatchRequestValidationError) Error() string
Error satisfies the builtin error interface
func (WatchRequestValidationError) ErrorName ¶
func (e WatchRequestValidationError) ErrorName() string
ErrorName returns error name.
func (WatchRequestValidationError) Field ¶
func (e WatchRequestValidationError) Field() string
Field function returns field value.
func (WatchRequestValidationError) Key ¶
func (e WatchRequestValidationError) Key() bool
Key function returns key value.
func (WatchRequestValidationError) Reason ¶
func (e WatchRequestValidationError) Reason() string
Reason function returns reason value.
type WebSocketAcceptFunc ¶
type WebSocketAcceptFunc func() (WebSocketInterface, error)
type WebSocketInterface ¶
type WebSocketInterface interface { Reader(ctx context.Context) (websocket.MessageType, io.Reader, error) Writer(ctx context.Context, typ websocket.MessageType) (io.WriteCloser, error) Close(statusCode websocket.StatusCode, reason string) error }
WebSocketInterface is used to interface with the websocket package. The purpose of this is NOT to hide the websocket package (as types of it are exposed), but to make the Watch Aggregator easily testable.
func WebSocketAccept ¶
func WebSocketAccept(w http.ResponseWriter, r *http.Request, allowedOrigins []string) (WebSocketInterface, error)