Documentation
¶
Index ¶
Constants ¶
const ( AccessLevelReadOnly = "readonly" AccessLevelReadWrite = "readwrite" AccessLevelAdmin = "admin" )
Access level constants
Variables ¶
This section is empty.
Functions ¶
func GetKubectlToolNames ¶ added in v0.0.5
func GetKubectlToolNames() []string
GetKubectlToolNames returns the names of all kubectl tools
func MapOperationToCommand ¶ added in v0.0.5
MapOperationToCommand maps consolidated operations to kubectl commands
func RegisterKubectlTools ¶ added in v0.0.5
RegisterKubectlTools returns kubectl tools filtered by access level
Types ¶
type KubectlCommand ¶
type KubectlCommand struct {
Name string
Description string
ArgsExample string // Example of command arguments, such as "pods" or "-f deployment.yaml"
}
KubectlCommand defines a specific kubectl command to be registered as a tool
func GetAdminKubectlCommands ¶
func GetAdminKubectlCommands() []KubectlCommand
GetAdminKubectlCommands returns all admin kubectl commands
func GetReadOnlyKubectlCommands ¶
func GetReadOnlyKubectlCommands() []KubectlCommand
GetReadOnlyKubectlCommands returns all read-only kubectl commands
func GetReadWriteKubectlCommands ¶
func GetReadWriteKubectlCommands() []KubectlCommand
GetReadWriteKubectlCommands returns all read-write kubectl commands
type KubectlExecutor ¶
type KubectlExecutor struct{}
KubectlExecutor implements the CommandExecutor interface for kubectl commands
func NewExecutor ¶
func NewExecutor() *KubectlExecutor
NewExecutor creates a new KubectlExecutor instance
func (*KubectlExecutor) Execute ¶
func (e *KubectlExecutor) Execute(params map[string]interface{}, cfg *config.ConfigData) (string, error)
Execute handles general kubectl command execution (for backward compatibility)
func (*KubectlExecutor) ExecuteSpecificCommand ¶
func (e *KubectlExecutor) ExecuteSpecificCommand(cmd string, params map[string]interface{}, cfg *config.ConfigData) (string, error)
ExecuteSpecificCommand executes a specific kubectl command with the given arguments
type KubectlToolExecutor ¶ added in v0.0.5
type KubectlToolExecutor struct {
// contains filtered or unexported fields
}
KubectlToolExecutor handles structured kubectl command execution for grouped tools
func NewKubectlToolExecutor ¶ added in v0.0.5
func NewKubectlToolExecutor() *KubectlToolExecutor
NewKubectlToolExecutor creates a new kubectl tool executor
func (*KubectlToolExecutor) Execute ¶ added in v0.0.5
func (e *KubectlToolExecutor) Execute(params map[string]interface{}, cfg *config.ConfigData) (string, error)
Execute processes structured kubectl commands with operation/resource/args parameters
func (*KubectlToolExecutor) GetCommandForValidation ¶ added in v0.0.5
func (e *KubectlToolExecutor) GetCommandForValidation(operation, resource, args string, toolName string) string
GetCommandForValidation returns the constructed command for security validation