api

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package api defines a set of Handlers to be used for implementing a fake API server, designed specifically to make Cluster API and the Kubeadm Control Plane provider happy during a stress test (it is not complete or production ready, and it will never be).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIServerHandler

func NewAPIServerHandler(manager inmemoryruntime.Manager, log logr.Logger, resolver ResourceGroupResolver) http.Handler

NewAPIServerHandler returns an http.Handler for a fake API server.

func NewDebugHandler

func NewDebugHandler(manager inmemoryruntime.Manager, log logr.Logger, infoProvider DebugInfoProvider) http.Handler

NewDebugHandler returns an http.Handler for debugging the server.

Types

type DebugInfoProvider

type DebugInfoProvider interface {
	ListListeners() map[string]string
}

DebugInfoProvider defines the methods the server must implement to provide debug info.

type Event

type Event struct {
	Type   watch.EventType `json:"type,omitempty"`
	Object runtime.Object  `json:"object,omitempty"`
}

Event records a lifecycle event for a Kubernetes object.

type ResourceGroupResolver

type ResourceGroupResolver func(host string) (string, error)

ResourceGroupResolver defines a func that can identify which workloadCluster/resourceGroup a request targets.

type WatchEventDispatcher

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

WatchEventDispatcher dispatches events for a single resourceGroup.

func (*WatchEventDispatcher) OnCreate

func (m *WatchEventDispatcher) OnCreate(resourceGroup string, o client.Object)

OnCreate dispatches Create events.

func (*WatchEventDispatcher) OnDelete

func (m *WatchEventDispatcher) OnDelete(resourceGroup string, o client.Object)

OnDelete dispatches Delete events.

func (*WatchEventDispatcher) OnGeneric

func (m *WatchEventDispatcher) OnGeneric(resourceGroup string, o client.Object)

OnGeneric dispatches Generic events.

func (*WatchEventDispatcher) OnUpdate

func (m *WatchEventDispatcher) OnUpdate(resourceGroup string, _, o client.Object)

OnUpdate dispatches Update events.

func (*WatchEventDispatcher) Run

Run serves a series of encoded events via HTTP with Transfer-Encoding: chunked.

Directories

Path Synopsis
Package portforward implements support for implementing a fake port forward service in the api.
Package portforward implements support for implementing a fake port forward service in the api.

Jump to

Keyboard shortcuts

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