api

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package api provides common helpers related to API calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAPICallSuccess

func CheckAPICallSuccess(ctx context.Context, errorContext string, resp *_http.Response, apiErr error) (err error)

CheckAPICallSuccess verifies whether an API response is successful or not and if not, populates an error with all the information needed. errorContext corresponds to the description of what led to the error if error there is e.g. `Failed adding a user`. resp corresponds to the HTTP response from a certain endpoint. The body of such response is not closed by this function. apiErr corresponds to the error which may be returned by the HTTP client when calling the endpoint.

func IsCallSuccessful

func IsCallSuccessful(r *_http.Response) bool

IsCallSuccessful determines whether an API response is successful or not

Types

This section is empty.

Jump to

Keyboard shortcuts

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