commands

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTimeout is the default timeout for command execution
	DefaultTimeout = 2 * time.Minute
	// DefaultCacheTTL is the default cache TTL
	DefaultCacheTTL = 1 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyOptions

type ApplyOptions struct {
	DryRun   bool
	Force    bool
	Wait     bool
	Validate bool
}

ApplyOptions represents options for apply commands

type CommandBuilder

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

CommandBuilder provides a fluent interface for building CLI commands

func ApplyResource

func ApplyResource(filename string, namespace string, options ApplyOptions) *CommandBuilder

ApplyResource creates a command to apply a resource

func ArgoRolloutsBuilder

func ArgoRolloutsBuilder() *CommandBuilder

ArgoRolloutsBuilder creates an argo rollouts command builder

func ArgoRolloutsGet

func ArgoRolloutsGet(rolloutName, namespace string) *CommandBuilder

ArgoRolloutsGet creates a command to get Argo rollouts

func CiliumBuilder

func CiliumBuilder() *CommandBuilder

CiliumBuilder creates a cilium command builder

func CiliumStatus

func CiliumStatus() *CommandBuilder

CiliumStatus creates a command to get Cilium status

func DeleteResource

func DeleteResource(resourceType, resourceName, namespace string, options DeleteOptions) *CommandBuilder

DeleteResource creates a command to delete a resource

func DescribeResource

func DescribeResource(resourceType, resourceName, namespace string) *CommandBuilder

DescribeResource creates a command to describe a resource

func GetDeployments

func GetDeployments(namespace string, labels map[string]string) *CommandBuilder

GetDeployments creates a command to get deployments

func GetLogs

func GetLogs(podName, namespace string, options LogOptions) *CommandBuilder

GetLogs creates a command to get logs

func GetPods

func GetPods(namespace string, labels map[string]string) *CommandBuilder

GetPods creates a command to get pods

func GetServices

func GetServices(namespace string, labels map[string]string) *CommandBuilder

GetServices creates a command to get services

func HelmBuilder

func HelmBuilder() *CommandBuilder

HelmBuilder creates a helm command builder

func HelmInstall

func HelmInstall(releaseName, chart, namespace string, options HelmInstallOptions) *CommandBuilder

HelmInstall creates a command to install a Helm chart

func HelmList

func HelmList(namespace string, options HelmListOptions) *CommandBuilder

HelmList creates a command to list Helm releases

func IstioCtlBuilder

func IstioCtlBuilder() *CommandBuilder

IstioCtlBuilder creates an istioctl command builder

func IstioProxyStatus

func IstioProxyStatus(podName, namespace string) *CommandBuilder

IstioProxyStatus creates a command to get Istio proxy status

func KubectlBuilder

func KubectlBuilder() *CommandBuilder

KubectlBuilder creates a kubectl command builder

func NewCommandBuilder

func NewCommandBuilder(command string) *CommandBuilder

NewCommandBuilder creates a new command builder

func (*CommandBuilder) Build

func (cb *CommandBuilder) Build() (string, []string, error)

Build constructs the final command arguments

func (*CommandBuilder) Execute

func (cb *CommandBuilder) Execute(ctx context.Context) (string, error)

Execute runs the command

func (*CommandBuilder) WithAnnotation

func (cb *CommandBuilder) WithAnnotation(key, value string) *CommandBuilder

WithAnnotation adds an annotation

func (*CommandBuilder) WithArgs

func (cb *CommandBuilder) WithArgs(args ...string) *CommandBuilder

WithArgs adds arguments to the command

func (*CommandBuilder) WithCache

func (cb *CommandBuilder) WithCache(cached bool) *CommandBuilder

WithCache enables caching of the command result

func (*CommandBuilder) WithCacheKey

func (cb *CommandBuilder) WithCacheKey(key string) *CommandBuilder

WithCacheKey sets a custom cache key

func (*CommandBuilder) WithCacheTTL

func (cb *CommandBuilder) WithCacheTTL(ttl time.Duration) *CommandBuilder

WithCacheTTL sets the cache TTL

func (*CommandBuilder) WithContext

func (cb *CommandBuilder) WithContext(context string) *CommandBuilder

WithContext sets the Kubernetes context

func (*CommandBuilder) WithDryRun

func (cb *CommandBuilder) WithDryRun(dryRun bool) *CommandBuilder

WithDryRun enables dry run mode

func (*CommandBuilder) WithForce

func (cb *CommandBuilder) WithForce(force bool) *CommandBuilder

WithForce enables force mode

func (*CommandBuilder) WithKubeconfig

func (cb *CommandBuilder) WithKubeconfig(kubeconfig string) *CommandBuilder

WithKubeconfig sets the kubeconfig file

func (*CommandBuilder) WithLabel

func (cb *CommandBuilder) WithLabel(key, value string) *CommandBuilder

WithLabel adds a label selector

func (*CommandBuilder) WithLabels

func (cb *CommandBuilder) WithLabels(labels map[string]string) *CommandBuilder

WithLabels adds multiple label selectors

func (*CommandBuilder) WithNamespace

func (cb *CommandBuilder) WithNamespace(namespace string) *CommandBuilder

WithNamespace sets the namespace

func (*CommandBuilder) WithOutput

func (cb *CommandBuilder) WithOutput(output string) *CommandBuilder

WithOutput sets the output format

func (*CommandBuilder) WithTimeout

func (cb *CommandBuilder) WithTimeout(timeout time.Duration) *CommandBuilder

WithTimeout sets the command timeout

func (*CommandBuilder) WithToken added in v0.0.15

func (cb *CommandBuilder) WithToken(token string) *CommandBuilder

WithToken sets the authentication token for kubectl commands

func (*CommandBuilder) WithValidation

func (cb *CommandBuilder) WithValidation(validate bool) *CommandBuilder

WithValidation enables/disables validation

func (*CommandBuilder) WithWait

func (cb *CommandBuilder) WithWait(wait bool) *CommandBuilder

WithWait enables wait mode

type DeleteOptions

type DeleteOptions struct {
	Force       bool
	GracePeriod int
	Wait        bool
}

DeleteOptions represents options for delete commands

type HelmInstallOptions

type HelmInstallOptions struct {
	CreateNamespace bool
	DryRun          bool
	Wait            bool
	ValuesFile      string
	SetValues       map[string]string
}

HelmInstallOptions represents options for Helm install commands

type HelmListOptions

type HelmListOptions struct {
	AllNamespaces bool
	Output        string
}

HelmListOptions represents options for Helm list commands

type LogOptions

type LogOptions struct {
	Container     string
	Follow        bool
	Previous      bool
	Timestamps    bool
	TailLines     int
	SinceTime     string
	SinceDuration string
}

LogOptions represents options for log commands

Jump to

Keyboard shortcuts

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