response

package
v1.7.10 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPResponse

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

func (*HTTPResponse) CloseBody added in v1.3.0

func (h *HTTPResponse) CloseBody()

func (*HTTPResponse) ErrorByStatusCode

func (h *HTTPResponse) ErrorByStatusCode() error

func (*HTTPResponse) GetBody

func (h *HTTPResponse) GetBody() ([]byte, error)

func (*HTTPResponse) GetContentType

func (h *HTTPResponse) GetContentType() string

func (*HTTPResponse) GetResponse

func (h *HTTPResponse) GetResponse() *http.Response

func (*HTTPResponse) GetStatusCode

func (h *HTTPResponse) GetStatusCode() int

func (*HTTPResponse) GetStatusCodeString

func (h *HTTPResponse) GetStatusCodeString() string

type Interface

type Interface interface {
	ErrorByStatusCode() error
	GetBody() ([]byte, error)
	GetResponse() *http.Response
	GetStatusCode() int
	GetStatusCodeString() string
	GetContentType() string
	CloseBody()
}

func NewHTTPResponse

func NewHTTPResponse(response *http.Response) Interface

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) CloseBody added in v1.3.0

func (m *Mock) CloseBody()

func (*Mock) ErrorByStatusCode

func (m *Mock) ErrorByStatusCode() error

func (*Mock) GetBody

func (m *Mock) GetBody() ([]byte, error)

func (*Mock) GetContentType

func (m *Mock) GetContentType() string

func (*Mock) GetResponse

func (m *Mock) GetResponse() *http.Response

func (*Mock) GetStatusCode

func (m *Mock) GetStatusCode() int

func (*Mock) GetStatusCodeString

func (m *Mock) GetStatusCodeString() string

Jump to

Keyboard shortcuts

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