k9s

package
v1.12.5 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package k9s provides a k9s client implementation.

Coverage Note: The DefaultK9sExecutor.Execute() method (line 20) and parts of the HandleConnectRunE execution path cannot be fully tested in unit tests because they require launching k9s which needs an actual terminal UI. These paths are validated through: - Integration testing with actual k9s installation - Manual verification of the connect command - Mock-based testing of all logic leading up to k9s execution

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps k9s command functionality.

func NewClient

func NewClient() *Client

NewClient creates a new k9s client instance with the default executor.

func NewClientWithExecutor

func NewClientWithExecutor(executor Executor) *Client

NewClientWithExecutor creates a new k9s client with a custom executor for testing.

func (*Client) CreateConnectCommand

func (c *Client) CreateConnectCommand(kubeConfigPath, context string) *cobra.Command

CreateConnectCommand creates a k9s command with all its flags and behavior.

type DefaultK9sExecutor

type DefaultK9sExecutor struct{}

DefaultK9sExecutor is the default implementation that calls k9s directly.

func (*DefaultK9sExecutor) Execute

func (e *DefaultK9sExecutor) Execute()

Execute calls the k9s cmd.Execute function.

type Executor

type Executor interface {
	Execute()
}

Executor defines the interface for executing k9s.

Jump to

Keyboard shortcuts

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