server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Overview

Package server contains the kwok server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.2.0

type Config struct {
	ClusterPortForwards []*internalversion.ClusterPortForward
	PortForwards        []*internalversion.PortForward
	ClusterExecs        []*internalversion.ClusterExec
	Execs               []*internalversion.Exec
	ClusterLogs         []*internalversion.ClusterLogs
	Logs                []*internalversion.Logs
	ClusterAttaches     []*internalversion.ClusterAttach
	Attaches            []*internalversion.Attach
}

Config holds configurations needed by the server handlers.

type Server

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

Server is a server that can serve HTTP/HTTPS requests.

func NewServer

func NewServer(config Config) *Server

NewServer creates a new Server.

func (*Server) AttachContainer

func (s *Server) AttachContainer(ctx context.Context, podName, podNamespace string, uid types.UID, containerName string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan clientremotecommand.TerminalSize) error

AttachContainer attaches to a container in a pod, copying data between in/out/err and the container's stdin/stdout/stderr.

func (*Server) ExecInContainer

func (s *Server) ExecInContainer(ctx context.Context, podName, podNamespace string, uid types.UID, container string, cmd []string, in io.Reader, out, errOut io.WriteCloser, tty bool, resize <-chan clientremotecommand.TerminalSize) error

ExecInContainer executes a command in a container.

func (*Server) GetContainerLogs

func (s *Server) GetContainerLogs(ctx context.Context, podName, podNamespace, container string, logOptions *corev1.PodLogOptions, stdout, stderr io.Writer) error

GetContainerLogs returns logs for a container in a pod. If follow is true, it streams the logs until the connection is closed by the client.

func (*Server) InstallDebuggingDisabledHandlers

func (s *Server) InstallDebuggingDisabledHandlers()

InstallDebuggingDisabledHandlers registers the HTTP request patterns that provide better error message

func (*Server) InstallDebuggingHandlers

func (s *Server) InstallDebuggingHandlers()

InstallDebuggingHandlers registers the HTTP request patterns that provide debugging functionality

func (*Server) InstallHealthz

func (s *Server) InstallHealthz()

InstallHealthz installs the healthz handler.

func (*Server) InstallMetrics

func (s *Server) InstallMetrics()

InstallMetrics registers the metrics handler on the given mux.

func (*Server) InstallProfilingHandler

func (s *Server) InstallProfilingHandler(enableProfilingLogHandler bool, enableContentionProfiling bool)

InstallProfilingHandler registers the HTTP request patterns for /debug/pprof endpoint.

func (*Server) PortForward

func (s *Server) PortForward(ctx context.Context, podName, podNamespace string, uid types.UID, port int32, stream io.ReadWriteCloser) error

PortForward handles a port forwarding request.

func (*Server) Run

func (s *Server) Run(ctx context.Context, address string, certFile, privateKeyFile string) error

Run runs the specified Server. This should never exit.

Directories

Path Synopsis
Package portforward contains server-side logic for handling port forwarding requests.
Package portforward contains server-side logic for handling port forwarding requests.
Package remotecommand contains functions related to executing commands in and attaching to pods.
Package remotecommand contains functions related to executing commands in and attaching to pods.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳