request

package
v0.0.0-...-f574766 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Headers

type Headers [][2]string

func (Headers) Get

func (h Headers) Get(key string) (string, bool)

type Interface

type Interface interface {
	URL() (*url.URL, error)
	Path() string
	Body() string
	Query() Query
	Method() string
	RawURL() string
	Expires() int
	Headers() Headers
	HTTPRequest(string) (*http.Request, error)
	json.Unmarshaler
	json.Marshaler
}

type Query

type Query [][2]string

func (Query) IsInclude

func (q Query) IsInclude(expectedKey string) bool

type Request

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

func New

func New(
	method string,
	urlString string,
	headers [][2]string,
	body string,
	expires int,
) *Request

func NewFromHTTPRequest

func NewFromHTTPRequest(r *http.Request) (*Request, error)

func ParseJSON

func ParseJSON(data []byte) (*Request, error)

func (*Request) Body

func (r *Request) Body() string

func (*Request) DelQueryValueByKey

func (r *Request) DelQueryValueByKey(key string) error

func (*Request) Expires

func (r *Request) Expires() int

func (*Request) HTTPRequest

func (r *Request) HTTPRequest(baseURL string) (*http.Request, error)

func (*Request) Headers

func (r *Request) Headers() Headers

func (*Request) MarshalJSON

func (r *Request) MarshalJSON() ([]byte, error)

func (*Request) Method

func (r *Request) Method() string

func (*Request) Path

func (r *Request) Path() string

func (*Request) Query

func (r *Request) Query() Query

func (*Request) RawURL

func (r *Request) RawURL() string

func (*Request) URL

func (r *Request) URL() (*url.URL, error)

func (*Request) UnmarshalJSON

func (r *Request) UnmarshalJSON(data []byte) error

func (*Request) UpdateHTTPRequest

func (ereq *Request) UpdateHTTPRequest(req *http.Request) error

Jump to

Keyboard shortcuts

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