response

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

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