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 ¶
NewClientWithExecutor creates a new k9s client with a custom executor for testing.
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.
type MockExecutor ¶ added in v1.14.0
MockExecutor is an autogenerated mock type for the Executor type
func NewMockExecutor ¶ added in v1.14.0
func NewMockExecutor(t interface {
mock.TestingT
Cleanup(func())
}) *MockExecutor
NewMockExecutor creates a new instance of MockExecutor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockExecutor) EXPECT ¶ added in v1.14.0
func (_m *MockExecutor) EXPECT() *MockExecutor_Expecter
func (*MockExecutor) Execute ¶ added in v1.14.0
func (_mock *MockExecutor) Execute()
Execute provides a mock function for the type MockExecutor
type MockExecutor_Execute_Call ¶ added in v1.14.0
MockExecutor_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
func (*MockExecutor_Execute_Call) Return ¶ added in v1.14.0
func (_c *MockExecutor_Execute_Call) Return() *MockExecutor_Execute_Call
func (*MockExecutor_Execute_Call) Run ¶ added in v1.14.0
func (_c *MockExecutor_Execute_Call) Run(run func()) *MockExecutor_Execute_Call
func (*MockExecutor_Execute_Call) RunAndReturn ¶ added in v1.14.0
func (_c *MockExecutor_Execute_Call) RunAndReturn(run func()) *MockExecutor_Execute_Call
type MockExecutor_Expecter ¶ added in v1.14.0
type MockExecutor_Expecter struct {
// contains filtered or unexported fields
}
func (*MockExecutor_Expecter) Execute ¶ added in v1.14.0
func (_e *MockExecutor_Expecter) Execute() *MockExecutor_Execute_Call
Execute is a helper method to define mock.On call