Documentation ¶
Index ¶
- func AuthenticatorStatusJSONResponse(resp *http.Response, obj interface{}) error
- func DataResponse(resp *http.Response) ([]byte, error)
- func DryRunPolicyJSONResponse(resp *http.Response, obj interface{}) error
- func EmptyResponse(resp *http.Response) error
- func JSONResponse(resp *http.Response, obj interface{}) error
- func JSONResponseWithAllowedStatusCodes(resp *http.Response, obj interface{}, allowedStatusCodes []int) error
- func NewConjurError(resp *http.Response) error
- func SecretDataResponse(resp *http.Response) (io.ReadCloser, error)
- type ConjurError
- type ConjurErrorDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticatorStatusJSONResponse ¶ added in v0.12.5
AuthenticatorStatusJSONResponse checks the HTTP status of the response. If it's less than 300 or equal to 500, it returns the response body as JSON. Otherwise it returns a NewConjurError.
func DataResponse ¶ added in v0.3.0
DataResponse checks the HTTP status of the response. If it's less than 300, it returns the response body as a byte array. Otherwise it returns a NewConjurError.
func DryRunPolicyJSONResponse ¶ added in v0.12.3
DryRunPolicyJSONResponse checks the HTTP status of the response. If it's less than 300 or equal to 422, it returns the response body as JSON. Otherwise it returns a NewConjurError.
func EmptyResponse ¶
EmptyResponse checks the HTTP status of the response. If it's less than 300, it returns without an error. Otherwise it returns a NewConjurError.
func JSONResponse ¶
JSONResponse checks the HTTP status of the response. If it's less than 300, it returns the response body as JSON. Otherwise it returns a NewConjurError.
func JSONResponseWithAllowedStatusCodes ¶ added in v0.12.5
func JSONResponseWithAllowedStatusCodes(resp *http.Response, obj interface{}, allowedStatusCodes []int) error
JSONResponseWithAllowedStatusCodes checks the HTTP status of the response. If it's less than 300 or equal to one of the provided values, it returns the response body as JSON. Otherwise it returns a NewConjurError.
func NewConjurError ¶
func SecretDataResponse ¶
func SecretDataResponse(resp *http.Response) (io.ReadCloser, error)
SecretDataResponse checks the HTTP status of the response. If it's less than 300, it returns the response body as a stream. Otherwise it returns a NewConjurError.
Types ¶
type ConjurError ¶
type ConjurError struct { Code int Message string Details *ConjurErrorDetails `json:"error"` }
func (*ConjurError) Error ¶
func (cerr *ConjurError) Error() string