Documentation ¶
Index ¶
- Constants
- func GetRollbackRetriesLimit(rollbackRetriesLimit *int32) int32
- func IsHTTPError(statusCode int) bool
- func IsHTTPSuccess(statusCode int) bool
- func IsRequestValid(method string, url string) error
- func IsUrlValid(input string) bool
- func RetriesLimitReached(statusFailed int32, rollbackRetriesLimit *int32) bool
- func RollBackEnabled(rollbackRetriesLimit *int32) bool
- func SetRequestResourceStatus(rr RequestResource, statusFuncs ...SetRequestStatusFunc) error
- func ShouldRetry(rollbackRetriesLimit *int32, statusFailed int32) bool
- func WaitTimeout(timeout *v1.Duration) time.Duration
- type CacheSetter
- type ErrorSetter
- type RequestDetailsSetter
- type RequestResource
- func (rr *RequestResource) ResetFailures() SetRequestStatusFunc
- func (rr *RequestResource) SetBody() SetRequestStatusFunc
- func (rr *RequestResource) SetCache() SetRequestStatusFunc
- func (rr *RequestResource) SetError(err error) SetRequestStatusFunc
- func (rr *RequestResource) SetHeaders() SetRequestStatusFunc
- func (rr *RequestResource) SetRequestDetails() SetRequestStatusFunc
- func (rr *RequestResource) SetStatusCode() SetRequestStatusFunc
- func (rr *RequestResource) SetSynced() SetRequestStatusFunc
- type ResetFailures
- type ResponseSetter
- type SetRequestStatusFunc
- type SyncedSetter
Constants ¶
View Source
const ( ErrInvalidURL = "invalid url %s" ErrStatusCode = "HTTP %s request failed with status code: %s" )
View Source
const (
ErrFailedToSetStatus = "failed to update status"
)
Variables ¶
This section is empty.
Functions ¶
func GetRollbackRetriesLimit ¶
func IsHTTPError ¶
IsHTTPError checks if an HTTP status code indicates an error.
func IsHTTPSuccess ¶
IsHTTPSuccess checks if an HTTP status code indicates success.
func IsRequestValid ¶
func IsUrlValid ¶
func RetriesLimitReached ¶
func RollBackEnabled ¶
func SetRequestResourceStatus ¶
func SetRequestResourceStatus(rr RequestResource, statusFuncs ...SetRequestStatusFunc) error
func ShouldRetry ¶
Types ¶
type CacheSetter ¶
type ErrorSetter ¶
type ErrorSetter interface {
SetError(err error)
}
type RequestDetailsSetter ¶
type RequestResource ¶
type RequestResource struct { Resource client.Object RequestContext context.Context HttpResponse httpClient.HttpResponse HttpRequest httpClient.HttpRequest LocalClient client.Client }
func (*RequestResource) ResetFailures ¶
func (rr *RequestResource) ResetFailures() SetRequestStatusFunc
func (*RequestResource) SetBody ¶
func (rr *RequestResource) SetBody() SetRequestStatusFunc
func (*RequestResource) SetCache ¶
func (rr *RequestResource) SetCache() SetRequestStatusFunc
func (*RequestResource) SetError ¶
func (rr *RequestResource) SetError(err error) SetRequestStatusFunc
func (*RequestResource) SetHeaders ¶
func (rr *RequestResource) SetHeaders() SetRequestStatusFunc
func (*RequestResource) SetRequestDetails ¶
func (rr *RequestResource) SetRequestDetails() SetRequestStatusFunc
func (*RequestResource) SetStatusCode ¶
func (rr *RequestResource) SetStatusCode() SetRequestStatusFunc
func (*RequestResource) SetSynced ¶
func (rr *RequestResource) SetSynced() SetRequestStatusFunc
type ResetFailures ¶
type ResetFailures interface {
ResetFailures()
}
type ResponseSetter ¶
type SetRequestStatusFunc ¶
type SetRequestStatusFunc func()
type SyncedSetter ¶
type SyncedSetter interface {
SetSynced(synced bool)
}
Click to show internal directories.
Click to hide internal directories.