Help us shape the future of Go! Take the 2026 Go Developer Survey

test

package
v1.61.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandResult

type CommandResult struct {
	Stdout   string
	Stderr   string
	ExitCode int
	Err      error
}

CommandResult holds the result of a command execution

func (CommandResult) String

func (r CommandResult) String() string

String returns a formatted string of the command result

type CommandRunner

type CommandRunner struct {
	ColorOutput bool
}

CommandRunner provides command execution with optional colored output

func NewCommandRunner

func NewCommandRunner(colorOutput bool) *CommandRunner

NewCommandRunner creates a new CommandRunner

func (*CommandRunner) Printf

func (c *CommandRunner) Printf(color, style, format string, args ...interface{})

Printf prints a formatted colored message

func (*CommandRunner) RunCommand

func (c *CommandRunner) RunCommand(name string, args ...string) CommandResult

RunCommand executes a command and returns the result

func (*CommandRunner) RunCommandQuiet

func (c *CommandRunner) RunCommandQuiet(name string, args ...string) CommandResult

RunCommandQuiet executes a command without output streaming

type ConfigMap

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

ConfigMap represents a Kubernetes ConfigMap

func (*ConfigMap) Get

func (c *ConfigMap) Get(key string) (string, error)

Get retrieves a ConfigMap value by key

type HelmChart

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

HelmChart represents a Helm chart with fluent interface

func NewHelmChart

func NewHelmChart(chartPath string) *HelmChart

NewHelmChart creates a new HelmChart builder

func (*HelmChart) Delete

func (h *HelmChart) Delete() *HelmChart

Delete deletes the Helm release

func (*HelmChart) DryRun

func (h *HelmChart) DryRun() *HelmChart

DryRun enables dry-run mode

func (*HelmChart) Error

func (h *HelmChart) Error() error

Error returns the last error

func (*HelmChart) GetConfigMap

func (h *HelmChart) GetConfigMap(name string) *ConfigMap

GetConfigMap returns a ConfigMap accessor

func (*HelmChart) GetPVC

func (h *HelmChart) GetPVC(name string) *PVC

GetPVC returns a PersistentVolumeClaim accessor

func (*HelmChart) GetPod

func (h *HelmChart) GetPod(selector string) *Pod

GetPod returns a Pod accessor for the current release

func (*HelmChart) GetSecret

func (h *HelmChart) GetSecret(name string) *Secret

GetSecret returns a Secret accessor

func (*HelmChart) GetStatefulSet

func (h *HelmChart) GetStatefulSet(name string) *StatefulSet

GetStatefulSet returns a StatefulSet accessor

func (*HelmChart) Install

func (h *HelmChart) Install() *HelmChart

Install installs the Helm chart

func (*HelmChart) MustSucceed

func (h *HelmChart) MustSucceed() *HelmChart

MustSucceed panics if there was an error

func (*HelmChart) Namespace

func (h *HelmChart) Namespace(ns string) *HelmChart

Namespace sets the namespace

func (*HelmChart) NoColor

func (h *HelmChart) NoColor() *HelmChart

NoColor disables colored output

func (*HelmChart) Release

func (h *HelmChart) Release(name string) *HelmChart

Release sets the release name

func (*HelmChart) Result

func (h *HelmChart) Result() CommandResult

Result returns the last command result

func (*HelmChart) SetValue

func (h *HelmChart) SetValue(key string, value interface{}) *HelmChart

SetValue sets a single value using dot notation

func (*HelmChart) Status

func (h *HelmChart) Status() (string, error)

Status returns the Helm release status

func (*HelmChart) Upgrade

func (h *HelmChart) Upgrade() *HelmChart

Upgrade upgrades the Helm release

func (*HelmChart) Values

func (h *HelmChart) Values(values map[string]interface{}) *HelmChart

Values sets or merges Helm values

func (*HelmChart) Wait

func (h *HelmChart) Wait() *HelmChart

Wait enables waiting for resources to be ready

func (*HelmChart) WaitFor

func (h *HelmChart) WaitFor(timeout time.Duration) *HelmChart

WaitFor sets the wait timeout

func (*HelmChart) WithPassword

func (h *HelmChart) WithPassword(secretName string) *HelmChart

WithPassword creates a password secret and uses it

type Kind

type Kind struct {
	Version     string `yaml:"version"`
	Name        string `yaml:"name"`
	UseExisting bool   `yaml:"use_existing"`
	ColorOutput bool   `yaml:"color_output"`
	// contains filtered or unexported fields
}

func NewKind

func NewKind(name string) *Kind

NewKind creates a new Kind cluster manager

func (*Kind) Delete

func (k *Kind) Delete() *Kind

Delete deletes the kind cluster

func (*Kind) Error

func (k *Kind) Error() error

Error returns the last error

func (*Kind) Exists

func (k *Kind) Exists() bool

Exists checks if the kind cluster exists

func (*Kind) GetKubeconfig

func (k *Kind) GetKubeconfig() (string, error)

GetKubeconfig returns the kubeconfig for the kind cluster

func (*Kind) GetOrCreate

func (k *Kind) GetOrCreate() *Kind

GetOrCreate gets an existing kind cluster or creates a new one

func (*Kind) LoadImage

func (k *Kind) LoadImage(image string) *Kind

LoadImage loads a docker image into the kind cluster

func (*Kind) MustSucceed

func (k *Kind) MustSucceed() *Kind

MustSucceed panics if there was an error

func (*Kind) NoColor

func (k *Kind) NoColor() *Kind

NoColor disables colored output

func (*Kind) Result

func (k *Kind) Result() CommandResult

Result returns the last command result

func (*Kind) SetKubeconfig

func (k *Kind) SetKubeconfig() *Kind

SetKubeconfig sets the KUBECONFIG environment variable to use the kind cluster

func (*Kind) Use

func (k *Kind) Use() *Kind

Use updates KUBECONFIG to use the kind cluster

func (*Kind) WithVersion

func (k *Kind) WithVersion(version string) *Kind

WithVersion sets the kind version to use

type Namespace

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

Namespace represents a Kubernetes namespace with fluent interface

func NewNamespace

func NewNamespace(name string) *Namespace

NewNamespace creates a new Namespace accessor

func (*Namespace) Create

func (n *Namespace) Create() *Namespace

Create creates the namespace

func (*Namespace) Delete

func (n *Namespace) Delete() *Namespace

Delete deletes the namespace

func (*Namespace) MustSucceed

func (n *Namespace) MustSucceed() *Namespace

MustSucceed panics if there was an error

type PVC

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

PVC represents a PersistentVolumeClaim

func (*PVC) Status

func (p *PVC) Status() (map[string]interface{}, error)

Status returns the PVC status

type Pod

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

Pod represents a Kubernetes pod with fluent interface

func (*Pod) Container

func (p *Pod) Container(name string) *Pod

Container sets the container name

func (*Pod) Error

func (p *Pod) Error() error

Error returns the last error

func (*Pod) Exec

func (p *Pod) Exec(command string) *Pod

Exec executes a command in the pod

func (*Pod) GetLogs

func (p *Pod) GetLogs(lines ...int) string

GetLogs retrieves pod logs

func (*Pod) MustSucceed

func (p *Pod) MustSucceed() *Pod

MustSucceed panics if there was an error

func (*Pod) Result

func (p *Pod) Result() string

Result returns the last command result

func (*Pod) Status

func (p *Pod) Status() (string, error)

Status returns the pod status

func (*Pod) WaitFor

func (p *Pod) WaitFor(condition string, timeout time.Duration) *Pod

WaitFor waits for a specific condition

func (*Pod) WaitReady

func (p *Pod) WaitReady() *Pod

WaitReady waits for the pod to be ready

type Secret

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

Secret represents a Kubernetes Secret

func (*Secret) Get

func (s *Secret) Get(key string) (string, error)

Get retrieves a secret value by key

type StatefulSet

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

StatefulSet represents a Kubernetes StatefulSet

func (*StatefulSet) GetGeneration

func (s *StatefulSet) GetGeneration() (int64, error)

GetGeneration returns the current generation

func (*StatefulSet) GetReplicas

func (s *StatefulSet) GetReplicas() (int, error)

GetReplicas returns the number of ready replicas

func (*StatefulSet) WaitFor

func (s *StatefulSet) WaitFor(timeout time.Duration) *StatefulSet

WaitFor waits for the StatefulSet rollout to complete

func (*StatefulSet) WaitReady

func (s *StatefulSet) WaitReady() *StatefulSet

WaitReady waits for the StatefulSet to be ready

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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