util

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package util provides common utilities for spf13/cobra CLI utilities that can be used for various commands within this project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains added in v0.3.3

func Contains[E comparable](s []E, v E) bool

func Index added in v0.3.3

func Index[E comparable](s []E, v E) int

func MustBindEnv added in v0.3.3

func MustBindEnv(input ...string)

func MustBindPFlag

func MustBindPFlag(key string, flag *pflag.Flag)

MustBindPFlag attempts to bind a specific key to a pflag (as used by cobra) and panics if the binding fails with a non-nil error.

func MustBootstrapDatastore added in v1.1.1

MustBootstrapDatastore returns the datastore's container, the datastore, and the URI to connect to it. It automatically cleans up the container after the test finishes.

func PrepareTempConfigDir added in v1.1.1

func PrepareTempConfigDir(t *testing.T) string

func PrepareTempConfigFile added in v1.1.1

func PrepareTempConfigFile(t *testing.T, config string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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