recv

package
v0.0.0-...-1259547 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 8 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(val *[]byte) http.Arrow

Bytes receive raw binary from HTTP response

func Code

func Code(code ...http.StatusCode) http.Arrow

Code is a mandatory statement to match expected HTTP Status Code against received one. The execution fails with StatusCode error if service responds with other value then specified one.

func Recv

func Recv(out interface{}) http.Arrow

Recv applies auto decoders for response and returns either binary or native Go data structure. The Content-Type header give a hint to decoder. Supply the pointer to data target data structure.

func ServedForm

func ServedForm() http.Arrow

ServedForm is a syntax sugar of Header("Content-Type", "application/x-www-form-urlencoded")

func ServedJSON

func ServedJSON() http.Arrow

ServedJSON is a syntax sugar of Header("Content-Type").Is("application/json")

Types

type THeader

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

THeader is tagged string, represents HTTP Header

func Header(header string) THeader

Header matches presence of header in the response or match its entire content. The execution fails with BadMatchHead if the matched value do not meet expectations.

func Served

func Served() THeader

Served is a syntax sugar of Header("Content-Type")

func (THeader) Any

func (header THeader) Any() http.Arrow

Any matches a header value, syntax sugar of Header(...).Is("*")

func (THeader) Is

func (header THeader) Is(value string) http.Arrow

Is matches value of HTTP header, Use wildcard string ("*") to match any header value

func (THeader) String

func (header THeader) String(value *string) http.Arrow

String matches a header value to closed variable of string type.

Jump to

Keyboard shortcuts

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