helper

package
Version: v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTPTimeout is a timeout for HTTP requests.
	HTTPTimeout = 30 * time.Second
)
View Source
const (
	// RootAnnoName is prefix for all kubedog annotations.
	RootAnnoName = "helmwave.dev/"
)

Variables

View Source
var (
	// Helm is an instance of helm CLI.
	Helm = helm.New()

	// HelmRegistryClient  is an instance of helm registry client.
	HelmRegistryClient *registry.Client
)

Functions

func Byte added in v0.12.0

func Byte(in interface{}) []byte

Byte marshals input to YAML and returns YAML byte slice.

func Contains

func Contains(t string, a []string) bool

Contains checks whether string exists in string slice.

func CreateFile

func CreateFile(p string) (*os.File, error)

CreateFile creates recursively basedir of file and returns created file object.

func Download added in v0.12.0

func Download(file, uri string) error

Download downloads uri to file.

func In added in v0.20.0

func In[T any, C EqualChecker[T]](search C, target []T) bool

In returns whether `search` appears in `target` slice.

func IsExists added in v0.12.0

func IsExists(s string) bool

IsExists return true if file exists.

func IsURL added in v0.12.0

func IsURL(str string) bool

IsURL reports whether provided string is a valid URL.

func KubeInit added in v0.17.0

func KubeInit() (err error)

KubeInit init kubeconfig for kubedog.

func NewCfg added in v0.12.2

func NewCfg(ns string) (*action.Configuration, error)

NewCfg creates helm internal configuration for provided namespace.

func NewHelm added in v0.12.2

func NewHelm(ns string) (*helm.EnvSettings, error)

NewHelm is a hack to create an instance of helm CLI and specifying namespace without environment variables.

func SaveInterface added in v0.12.0

func SaveInterface(file string, in interface{}) error

SaveInterface encodes input to YAML and saves to file.

func String added in v0.12.0

func String(in interface{}) string

String marshals input to YAML and returns YAML string.

Types

type EqualChecker added in v0.20.0

type EqualChecker[T any] interface {
	Equal(T) bool
}

EqualChecker is an interface that allows to check interface for equality.

Jump to

Keyboard shortcuts

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