watch_aggregator

package
v17.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_internal_module_kubernetes_api_server_watch_aggregator_watch_aggregator_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ProxyRequest

type ProxyRequest func(w http.ResponseWriter, r *http.Request) bool /* abort */

type WatchAggregator

type WatchAggregator struct {
	// contains filtered or unexported fields
}

func NewWatchAggregator

func NewWatchAggregator(log *slog.Logger, api modshared.API, v prototool.Validator, 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,proto3,oneof" json:"resource_version,omitempty"`
	AllowWatchBookmarks *bool   `protobuf:"varint,6,opt,name=allow_watch_bookmarks,proto3,oneof" json:"allow_watch_bookmarks,omitempty"`
	SendInitialEvents   *bool   `protobuf:"varint,7,opt,name=send_initial_events,proto3,oneof" json:"send_initial_events,omitempty"`
	FieldSelector       *string `protobuf:"bytes,8,opt,name=field_selector,proto3,oneof" json:"field_selector,omitempty"`
	LabelSelector       *string `protobuf:"bytes,9,opt,name=label_selector,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

type WatchRequest

type WatchRequest struct {
	WatchId     string       `protobuf:"bytes,1,opt,name=watch_id,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,proto3" 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

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)

Jump to

Keyboard shortcuts

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