Documentation ¶
Index ¶
- func BillingRef(billingRef string) error
- func DefaultResponseErrorHandler(resp *http.Response) error
- func Duration(s string) (time.Duration, error)
- func ISO8601(t string) error
- func ProjectID(projectID string) error
- func ProjectName(name string) error
- func RFC3339(t string) error
- func Response(resp interface{}, requestError error, checkNullFields ...string) error
- func SemVer(version string) error
- func StatusEquals(a ResponseInterface, statusCode ...int) bool
- func UUID(id string) error
- type ResponseInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BillingRef ¶
BillingRef validates a given billing reference
func DefaultResponseErrorHandler ¶
DefaultResponseErrorHandler is the default error handler used to check if a giving STACKIT API response returned an error
func Response ¶ added in v1.9.0
Response validates a response interface and error if requestError has an error, it is returned if resp.Error is defined and not nil, it is returned if one of the field namess provided in []checkNullFields are nil, an error is returned
func StatusEquals ¶ added in v1.17.1
func StatusEquals(a ResponseInterface, statusCode ...int) bool
StatusEquals returns true if interface.StatusCode() equals a given http code if more than one status code is provided, the function will return true if one of them matches
Types ¶
type ResponseInterface ¶ added in v1.16.0
type ResponseInterface interface {
StatusCode() int
}
Click to show internal directories.
Click to hide internal directories.