rest

package
v1.3.11 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MPL-2.0 Imports: 11 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(requestContext RequestContext) ([]byte, error, *http.Response)

func (JsonClient) Get

func (jc JsonClient) Get(context RequestContext) ([]byte, error, *http.Response)

func (JsonClient) Post

func (jc JsonClient) Post(context RequestContext) ([]byte, error, *http.Response)

func (JsonClient) ScanToTarget

func (jc JsonClient) ScanToTarget(context RequestContext, target interface{}) error

func (JsonClient) ScanToTargetRecoveringOnProxyFailure

func (jc JsonClient) ScanToTargetRecoveringOnProxyFailure(context 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