util

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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