request

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 = &SRequestError{"load bytes joiner"}
	ErrDecodeRequest   = &SRequestError{"decode request"}
	ErrUnknownType     = &SRequestError{"unknown type"}
)

Functions

This section is empty.

Types

type IRequest

type IRequest interface {
	types.IConverter

	WithHead(map[string]string) IRequest
	WithBody([]byte) IRequest

	GetMethod() string
	GetHost() string
	GetPath() string
	GetHead() map[string]string
	GetBody() []byte
}

func LoadRequest

func LoadRequest(pData interface{}) (IRequest, error)

func NewRequest

func NewRequest(pMethod, pHost, pPath string) IRequest

type SRequest added in v1.6.11

type SRequest struct {
	SRequestBlock
	FBody []byte `json:"body"`
}

func (*SRequest) GetBody added in v1.6.11

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

func (*SRequest) GetHead added in v1.6.11

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

func (*SRequest) GetHost added in v1.6.11

func (p *SRequest) GetHost() string

func (*SRequest) GetMethod added in v1.6.11

func (p *SRequest) GetMethod() string

func (*SRequest) GetPath added in v1.6.11

func (p *SRequest) GetPath() string

func (*SRequest) ToBytes added in v1.6.11

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

func (*SRequest) ToString added in v1.6.11

func (p *SRequest) ToString() string

func (*SRequest) WithBody added in v1.6.11

func (p *SRequest) WithBody(pBody []byte) IRequest

func (*SRequest) WithHead added in v1.6.11

func (p *SRequest) WithHead(pHead map[string]string) IRequest

type SRequestBlock added in v1.6.11

type SRequestBlock struct {
	FMethod string            `json:"method"`
	FHost   string            `json:"host"`
	FPath   string            `json:"path"`
	FHead   map[string]string `json:"head"`
}

type SRequestError added in v1.6.11

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

func (*SRequestError) Error added in v1.6.11

func (err *SRequestError) Error() string

Jump to

Keyboard shortcuts

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