helpers

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package helpers offers functions to simplify dealing with kubernetes resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Helpers

type Helpers interface {
	PodHelper
	ServiceHelper
}

Helpers offers Helper functions grouped by the objects they handle

func NewHelper

func NewHelper(ctx context.Context, client *resources.Client, namespace string) Helpers

NewHelper creates a set of helper functions on the default namespace

type PodHelper

type PodHelper interface {
	// WaitPodRunning waits for the Pod to be running for up to given timeout (in seconds) and returns
	// a boolean indicating if the status was reached. If the pod is Failed returns error.
	WaitPodRunning(name string, timeout uint) (bool, error)
}

PodHelper defines helper functions for manipulating Pods

type ServiceHelper

type ServiceHelper interface {
	// WaitServiceReady waits for the given service to have at least one endpoint available
	// or the timeout (in seconds) expires. It returns a boolean indicating if the service is ready
	WaitServiceReady(service string, timeout uint) (bool, error)
	// GetExternalIP returns one external ip for the given service. If none is assigned after the timeout
	// expires, returns an empty address "".
	GetExternalIP(service string, timeout uint) (string, error)
}

ServiceHelper implements functions for dealing with services

Jump to

Keyboard shortcuts

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