kubeclient

package
v0.0.0-...-86c1652 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

View Source
const PlainStreamProtocolName = "plain.virtualization.deckhouse.io"
View Source
const (
	WebsocketMessageBufferSize = 10240
)

Variables

View Source
var GetClientFromClientConfig = func(cmdConfig clientcmd.ClientConfig) (Client, error) {
	config, err := cmdConfig.ClientConfig()
	if err != nil {
		return nil, err
	}
	return GetClientFromRESTConfig(config)
}

Functions

func Copy

func Copy(dst, src *websocket.Conn) (int64, error)

func CopyFrom

func CopyFrom(dst io.Writer, src *websocket.Conn) (written int64, err error)

func CopyTo

func CopyTo(dst *websocket.Conn, src io.Reader) (written int64, err error)

func DefaultClientConfig

func DefaultClientConfig(flags *pflag.FlagSet) clientcmd.ClientConfig

func Dial

func Dial(address string, tlsConfig *tls.Config) (*websocket.Conn, *http.Response, error)

func NewUpgrader

func NewUpgrader() *websocket.Upgrader

func NewWebsocketStreamer

func NewWebsocketStreamer(conn *websocket.Conn, done chan struct{}) *wsStreamer

func RequestFromConfig

func RequestFromConfig(config *rest.Config, resource, name, namespace, subresource string, queryParams url.Values) (*http.Request, error)

Types

type AsyncSubresourceError

type AsyncSubresourceError struct {
	StatusCode int
	// contains filtered or unexported fields
}

func (*AsyncSubresourceError) Error

func (a *AsyncSubresourceError) Error() string

func (*AsyncSubresourceError) GetStatusCode

func (a *AsyncSubresourceError) GetStatusCode() int

type Client

type Client interface {
	ClusterVirtualMachineImages() virtualizationv1alpha2.ClusterVirtualMachineImageInterface
	VirtualMachines(namespace string) VirtualMachineInterface
	VirtualMachineImages(namespace string) virtualizationv1alpha2.VirtualMachineImageInterface
	VirtualMachineDisks(namespace string) virtualizationv1alpha2.VirtualMachineDiskInterface
	VirtualMachineBlockDeviceAttachments(namespace string) virtualizationv1alpha2.VirtualMachineBlockDeviceAttachmentInterface
	VirtualMachineIPAddressClaims(namespace string) virtualizationv1alpha2.VirtualMachineIPAddressClaimInterface
	VirtualMachineIPAddressLeases() virtualizationv1alpha2.VirtualMachineIPAddressLeaseInterface
	VirtualMachineOperations(namespace string) virtualizationv1alpha2.VirtualMachineOperationInterface
	VirtualMachineCPUModels() virtualizationv1alpha2.VirtualMachineCPUModelInterface
}

func GetClientFromRESTConfig

func GetClientFromRESTConfig(config *rest.Config) (Client, error)

type RoundTripCallback

type RoundTripCallback func(conn *websocket.Conn, resp *http.Response, err error) error

type SerialConsoleOptions

type SerialConsoleOptions struct {
	ConnectionTimeout time.Duration
}

type StreamInterface

type StreamInterface interface {
	Stream(options StreamOptions) error
	AsConn() net.Conn
}

type StreamOptions

type StreamOptions struct {
	In  io.Reader
	Out io.Writer
}

type VirtualMachineInterface

type VirtualMachineInterface interface {
	virtualizationv1alpha2.VirtualMachineInterface
	SerialConsole(name string, options *SerialConsoleOptions) (StreamInterface, error)
	VNC(name string) (StreamInterface, error)
	PortForward(name string, opts v1alpha2.VirtualMachinePortForward) (StreamInterface, error)
}

type WebsocketRoundTripper

type WebsocketRoundTripper struct {
	Dialer *websocket.Dialer
	Do     RoundTripCallback
}

func (*WebsocketRoundTripper) RoundTrip

func (d *WebsocketRoundTripper) RoundTrip(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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