types

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequest

func NewRequest(method, host string, opts ...RequestOption) (*http.Request, error)

NewRequest return valid http.Request struct from given arguments

func NewResponse

func NewResponse(status int, opts ...ResponseOption) (*http.Response, error)

NewResponse return valid http.Response struct from given arguments

Types

type HeaderRange

type HeaderRange interface {
	Range(f func(key string, value string) bool)
}

HeaderRange defines an interface implement Range function for iterating over header values and populating them into a target

type RequestOption

type RequestOption func(req *http.Request) error

func WithRequestHeader

func WithRequestHeader(headers map[string][]string) RequestOption

func WithRequestHeaderRangeSetter

func WithRequestHeaderRangeSetter(hr HeaderRange) RequestOption

func WithRequestURI

func WithRequestURI(rawURI string) RequestOption

type ResponseOption

type ResponseOption func(res *http.Response) error

func WithResponseHeaderRangeSetter

func WithResponseHeaderRangeSetter(hr HeaderRange) ResponseOption

Jump to

Keyboard shortcuts

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