tools

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Elide

func Elide(value string) string

Elide returns the first bit of its input string with a suffix of "..." if it's longer than a comfortable 40 characters.

func MakeNewPassword

func MakeNewPassword(oldPass string) string

MakeNewPassword generates a new string that's guaranteed to be different than the given one.

func PrintResource

func PrintResource(t *testing.T, resource any)

PrintResource returns a resource as a readable structure

func RandomFunnyString

func RandomFunnyString(length int) string

RandomFunnyString returns a random string of the given length filled with funny Unicode code points.

func RandomFunnyStringNoSlash

func RandomFunnyStringNoSlash(length int) string

RandomFunnyStringNoSlash returns a random string of the given length filled with funny Unicode code points, but no forward slash.

func RandomInt

func RandomInt(min, max int) int

RandomInt will return a random integer between a specified range.

func RandomString

func RandomString(prefix string, n int) string

RandomString generates a string of given length, but random content. All content will be within the ASCII graphic character set.

func WaitFor

func WaitFor(predicate func(context.Context) (bool, error)) error

WaitFor uses WaitForTimeout to poll a predicate function once per second to wait for a certain state to arrive, with a default timeout of 600 seconds.

func WaitForTimeout

func WaitForTimeout(predicate func(context.Context) (bool, error), timeout time.Duration) error

WaitForTimeout polls a predicate function once per second to wait for a certain state to arrive, or until the given timeout is reached.

Types

This section is empty.

Jump to

Keyboard shortcuts

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