responses

package
v0.0.0-...-4f1c8e6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(response AcsResponse, httpResponse *http.Response, format string) (err error)

Unmarshal return response body

Types

type AcsResponse

type AcsResponse interface {
	IsSuccess() bool
	GetHttpStatus() int
	GetHttpHeaders() map[string][]string
	GetHttpContentString() string
	GetHttpContentBytes() []byte
	GetOriginHttpResponse() *http.Response
	// contains filtered or unexported methods
}

AcsResponse interface

type BaseResponse

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

BaseResponse wrap originHttpResponse

func (*BaseResponse) GetHttpContentBytes

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

GetHttpContentBytes returns httpContentBytes

func (*BaseResponse) GetHttpContentString

func (baseResponse *BaseResponse) GetHttpContentString() string

GetHttpContentString returns httpContentString

func (*BaseResponse) GetHttpHeaders

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

GetHttpHeaders returns httpHeaders

func (*BaseResponse) GetHttpStatus

func (baseResponse *BaseResponse) GetHttpStatus() int

GetHttpStatus returns httpStatus

func (*BaseResponse) GetOriginHttpResponse

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

GetOriginHttpResponse returns originHttpResponse

func (*BaseResponse) IsSuccess

func (baseResponse *BaseResponse) IsSuccess() bool

IsSuccess checks weather httpStatus is 200 or not

func (*BaseResponse) String

func (baseResponse *BaseResponse) String() string

String returns base response content

type CommonResponse

type CommonResponse struct {
	*BaseResponse
}

CommonResponse wrap base response

func NewCommonResponse

func NewCommonResponse() (response *CommonResponse)

NewCommonResponse return common response

Jump to

Keyboard shortcuts

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