rest

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateResponse

func ValidateResponse(url string, resp *http.Response, respBody []byte) error

Types

type BadResponseCodeError

type BadResponseCodeError struct {
	// contains filtered or unexported fields
}

func NewBadResponseCodeError

func NewBadResponseCodeError(url string, resp *http.Response, respBody []byte) BadResponseCodeError

func (BadResponseCodeError) Error

func (brce BadResponseCodeError) Error() string

type JSONClient

type JSONClient struct{}

func NewJSONClient

func NewJSONClient() *JSONClient

func (*JSONClient) CallAPI

func (jc *JSONClient) CallAPI(ctx context.Context, requestContext *RequestContext) ([]byte, *http.Response, error)

func (*JSONClient) Get

func (jc *JSONClient) Get(ctx context.Context, req *RequestContext) ([]byte, *http.Response, error)

func (*JSONClient) Post

func (jc *JSONClient) Post(ctx context.Context, req *RequestContext) ([]byte, *http.Response, error)

func (*JSONClient) ScanToTarget

func (jc *JSONClient) ScanToTarget(ctx context.Context, req *RequestContext, target interface{}) error

func (*JSONClient) ScanToTargetRecoveringOnProxyFailure

func (jc *JSONClient) ScanToTargetRecoveringOnProxyFailure(ctx context.Context, req *RequestContext, target interface{}) error

type RequestContext

type RequestContext struct {
	TargetURL    string
	Method       string
	Body         string
	Headers      map[string]string
	ProxyURL     string
	LoggingTopic string
	IsVerbose    bool
}

func (*RequestContext) String

func (rc *RequestContext) String() string

Jump to

Keyboard shortcuts

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