response

package
v0.0.0-...-1290ed6 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataResponse

func DataResponse(resp *http.Response) ([]byte, error)

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 EmptyResponse

func EmptyResponse(resp *http.Response) error

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

func JSONResponse(resp *http.Response, obj interface{}) error

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 NewConjurError

func NewConjurError(resp *http.Response) error

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 (self *ConjurError) Error() string

type ConjurErrorDetails

type ConjurErrorDetails struct {
	Message string
	Code    string
	Target  string
	Details map[string]interface{}
}

Jump to

Keyboard shortcuts

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