response

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(resp ForpayResponse, httpResponse *http.Response) error

Unmarshal parses the JSON-encodeded data and stores the value in ForpayResponse.

Types

type BaseResponse

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

BaseResponse implements ForpayResponse interface.

func (*BaseResponse) GetHTTPContentBytes

func (baseResponse *BaseResponse) GetHTTPContentBytes() []byte

GetHTTPContentBytes returns http response body bytes.

func (*BaseResponse) GetHTTPHeaders

func (baseResponse *BaseResponse) GetHTTPHeaders() map[string][]string

GetHTTPHeaders returns http headers from response.

func (*BaseResponse) GetHTTPStatus

func (baseResponse *BaseResponse) GetHTTPStatus() int

GetHTTPStatus returns http status of the response.

func (*BaseResponse) GetOriginHTTPResponse

func (baseResponse *BaseResponse) GetOriginHTTPResponse() *http.Response

GetOriginHTTPResponse returns raw http response.

func (*BaseResponse) IsSuccess

func (baseResponse *BaseResponse) IsSuccess() bool

IsSuccess tells if the http request succeed.

func (*BaseResponse) String

func (baseResponse *BaseResponse) String() string

type Error

type Error struct {
	HTTPStatus int

	Code    int
	Msg     string
	SubCode string
	SubMsg  string
}

Error represents forpay api error structure.

func (*Error) Error

func (err *Error) Error() string

func (*Error) IsBusinessFailed

func (err *Error) IsBusinessFailed() bool

IsBusinessFailed tells if request business(action) failed.

type ForpayResponse

type ForpayResponse interface {
	IsSuccess() bool

	GetHTTPStatus() int
	GetHTTPHeaders() map[string][]string
	GetHTTPContentBytes() []byte
	GetOriginHTTPResponse() *http.Response
	// contains filtered or unexported methods
}

ForpayResponse defines forpay response structure.

Jump to

Keyboard shortcuts

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