response

package
v1.6.12 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLoadBytesJoiner = &SResponseError{"load bytes joiner"}
	ErrDecodeResponse  = &SResponseError{"decode response"}
	ErrUnknownType     = &SResponseError{"unknown type"}
)

Functions

This section is empty.

Types

type IResponse

type IResponse interface {
	types.IConverter

	WithHead(map[string]string) IResponse
	WithBody(pBody []byte) IResponse

	GetCode() int
	GetHead() map[string]string
	GetBody() []byte
}

func LoadResponse

func LoadResponse(pData interface{}) (IResponse, error)

func NewResponse

func NewResponse(pCode int) IResponse

type SResponse added in v1.6.11

type SResponse struct {
	SResponseBlock
	FBody []byte `json:"body"`
}

func (*SResponse) GetBody added in v1.6.11

func (p *SResponse) GetBody() []byte

func (*SResponse) GetCode added in v1.6.11

func (p *SResponse) GetCode() int

func (*SResponse) GetHead added in v1.6.11

func (p *SResponse) GetHead() map[string]string

func (*SResponse) ToBytes added in v1.6.11

func (p *SResponse) ToBytes() []byte

func (*SResponse) ToString added in v1.6.11

func (p *SResponse) ToString() string

func (*SResponse) WithBody added in v1.6.11

func (p *SResponse) WithBody(pBody []byte) IResponse

func (*SResponse) WithHead added in v1.6.11

func (p *SResponse) WithHead(pHead map[string]string) IResponse

type SResponseBlock added in v1.6.11

type SResponseBlock struct {
	FCode int               `json:"code"`
	FHead map[string]string `json:"head"`
}

type SResponseError added in v1.6.11

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

func (*SResponseError) Error added in v1.6.11

func (err *SResponseError) Error() string

Jump to

Keyboard shortcuts

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