Documentation ¶
Index ¶
- Constants
- func BeControlledBy(owner client.Object) types.GomegaMatcher
- func DeleteIfExists(c *client.Client, obj client.Object) func(ctx context.Context) error
- func RandomString(n int, opts ...RandomStringOption) string
- func SetupContext() context.Context
- func SetupNamespace(c *client.Client) *corev1.Namespace
- func SetupObject(c *client.Client, obj client.Object, f func())
- func SetupObjectStruct[O interface{ ... }, OStruct any](c *client.Client, f func(obj O)) O
- type Charset
- type DelegatingContext
- type RandomStringOption
- type RandomStringOptions
Constants ¶
const LowerCaseAlphabetCharset = "abcdefghijklmnopqrstuvwxyz"
LowerCaseAlphabetCharset is a charset consisting of lower-case alphabet letters.
Variables ¶
This section is empty.
Functions ¶
func BeControlledBy ¶
func BeControlledBy(owner client.Object) types.GomegaMatcher
BeControlledBy matches any object that is controlled by the given owner.
func DeleteIfExists ¶
DeleteIfExists returns a function to clean up an object if it exists.
func RandomString ¶
func RandomString(n int, opts ...RandomStringOption) string
RandomString generates a random string of length n with the given options. If n is negative, RandomString panics.
func SetupContext ¶
func SetupNamespace ¶
SetupNamespace sets up a namespace before each test and tears the namespace down after each test.
Types ¶
type Charset ¶
type Charset string
Charset specifies an explicit charset to use.
func (Charset) ApplyToRandomString ¶
func (s Charset) ApplyToRandomString(o *RandomStringOptions)
ApplyToRandomString implements RandomStringOption.
type DelegatingContext ¶
type DelegatingContext struct {
// contains filtered or unexported fields
}
func NewDelegatingContext ¶
func NewDelegatingContext(ctx context.Context) *DelegatingContext
func (*DelegatingContext) Deadline ¶
func (d *DelegatingContext) Deadline() (deadline time.Time, ok bool)
func (*DelegatingContext) Done ¶
func (d *DelegatingContext) Done() <-chan struct{}
func (*DelegatingContext) Err ¶
func (d *DelegatingContext) Err() error
func (*DelegatingContext) Fulfill ¶
func (d *DelegatingContext) Fulfill(ctx context.Context)
func (*DelegatingContext) Value ¶
func (d *DelegatingContext) Value(key interface{}) interface{}
type RandomStringOption ¶
type RandomStringOption interface { // ApplyToRandomString modifies the given RandomStringOptions with the option settings. ApplyToRandomString(o *RandomStringOptions) }
RandomStringOption is an option to RandomString.
type RandomStringOptions ¶
type RandomStringOptions struct { // Charset overrides the default RandomString charset if non-empty. Charset string }
RandomStringOptions are options for RandomString.
func (*RandomStringOptions) ApplyOptions ¶
func (o *RandomStringOptions) ApplyOptions(opts []RandomStringOption)
ApplyOptions applies the slice of RandomStringOption to the RandomStringOptions.
func (*RandomStringOptions) ApplyToRandomString ¶
func (o *RandomStringOptions) ApplyToRandomString(o2 *RandomStringOptions)
ApplyToRandomString implements RandomStringOption.