Documentation ¶
Index ¶
- Constants
- func CheckEmpty(value string, name string)
- func CheckError(err error)
- func CheckResponse(response Response, err error, expectedStatus int)
- func CreateConnectionWithToken(token string, tokenURL string, gatewayURL string, clientID string, ...) *client.Connection
- func GetLogger() logging.Logger
- func RunAttempt(attempt func() (interface{}, bool), maxAttempts int, delay time.Duration) (interface{}, error)
- func WaitForBackendToBeReady(ctx context.Context, connection *client.Connection)
- type Response
Constants ¶
const (
ResponseHeader = "X-Operation-ID"
)
******************************************************************************** Helper functions that were copied from uhc-clusters-service gitlab repository
Variables ¶
This section is empty.
Functions ¶
func CheckEmpty ¶
func CheckError ¶
func CheckError(err error)
func CheckResponse ¶
func RunAttempt ¶
func RunAttempt(attempt func() (interface{}, bool), maxAttempts int, delay time.Duration) (interface{}, error)
RunAttempt will run a function (attempt), until the function returns false - meaning no further attempts should follow, or until the number of attempts reached maxAttempts. Between each 2 attempts, it will wait for a given delay time. In case maxAttempts have been reached, an error will be returned, with the latest attempt result. The attempt function should return true as long as another attempt should be made, false when no further attempts are required - i.e. the attempt succeeded, and the result is available as returned value.
func WaitForBackendToBeReady ¶
func WaitForBackendToBeReady(ctx context.Context, connection *client.Connection)