kube

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultExecutor

type DefaultExecutor struct {
	Clientset  kubernetes.Interface
	RestConfig *rest.Config
}

DefaultExecutor implements Executor.

func (*DefaultExecutor) Exec

func (e *DefaultExecutor) Exec(
	ctx context.Context,
	namespace string,
	podName string,
	containerName string,
	cmd []string,
	stdin io.Reader,
	stdout io.Writer,
	stderr io.Writer,
) error

Exec executes a command in a specific container of a pod.

func (*DefaultExecutor) PortForward

func (e *DefaultExecutor) PortForward(
	namespace string,
	podName string,
	remotePort int,
	outStream, errStream io.Writer,
) (int, chan struct{}, error)

PortForward establishes a port forwarding session to a pod. It returns the local port, a stop channel to close the connection, and an error.

type Executor

type Executor interface {
	PortForward(namespace, podName string, remotePort int, out, errOut io.Writer) (int, chan struct{}, error)
	Exec(
		ctx context.Context,
		namespace, podName, container string,
		cmd []string,
		stdin io.Reader,
		out, errOut io.Writer,
	) error
}

Executor abstracts Kubernetes operations.

Jump to

Keyboard shortcuts

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