helpers

package
v0.0.0-...-ec15cf2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginOpts

type LoginOpts struct {
	Password string // default 'complement_meets_min_password_requirement'
	DeviceID string // default ” (generate new)
}

type RegistrationOpts

type RegistrationOpts struct {
	LocalpartSuffix string // default ” (don't care)
	DeviceID        string // default ” (generate new)
	Password        string // default 'complement_meets_min_password_requirement'
	IsAdmin         bool   // default false
}

type Waiter

type Waiter struct {
	// contains filtered or unexported fields
}

Waiter is a simple primitive to wait for a signal asynchronously. It is preferred over other sync primitives due to having more sensible defaults such as built-in timeouts if the signal does not appear and ability to signal more than once without panicking.

func NewWaiter

func NewWaiter() *Waiter

NewWaiter returns a generic struct which can be waited on until `Waiter.Finish` is called. A Waiter is similar to a `sync.WaitGroup` of size 1, but without the ability to underflow and with built-in timeouts.

func (*Waiter) Finish

func (w *Waiter) Finish()

Finish will cause all goroutines waiting via Wait to stop waiting and return. Once this function has been called, subsequent calls to Wait will return immediately. To begin waiting again, make a new Waiter.

func (*Waiter) Wait

func (w *Waiter) Wait(t ct.TestLike, timeout time.Duration)

Wait blocks until Finish() is called or until the timeout is reached. If the timeout is reached, the test is failed.

func (*Waiter) Waitf

func (w *Waiter) Waitf(t ct.TestLike, timeout time.Duration, errFormat string, args ...interface{})

Waitf blocks until Finish() is called or until the timeout is reached. If the timeout is reached, the test is failed with the given error message.

Jump to

Keyboard shortcuts

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