Documentation ¶
Overview ¶
Package util provides common utilities for spf13/cobra CLI utilities that can be used for various commands within this project.
Index ¶
- func Contains[E comparable](s []E, v E) bool
- func Index[E comparable](s []E, v E) int
- func MustBindEnv(input ...string)
- func MustBindPFlag(key string, flag *pflag.Flag)
- func MustBootstrapDatastore(t testing.TB, engine string) (storagefixtures.DatastoreTestContainer, storage.OpenFGADatastore, string)
- func PrepareTempConfigDir(t *testing.T) string
- func PrepareTempConfigFile(t *testing.T, config string)
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 ¶
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
func MustBootstrapDatastore(t testing.TB, engine string) (storagefixtures.DatastoreTestContainer, storage.OpenFGADatastore, string)
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 PrepareTempConfigFile ¶ added in v1.1.1
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.