httpx

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrNotAcceptable

func ErrNotAcceptable(err error) error

func ErrNotFound

func ErrNotFound(err error) error

func ErrUnprocessableEntity

func ErrUnprocessableEntity(err error) error

func Request

func Request(ctx context.Context, client *http.Client, method, url, contentType string, body io.Reader, resp interface{}) (err error)

Request fn with mucho magic

Types

type Context

type Context struct {
	ResponseWriter http.ResponseWriter
	Request        *http.Request
	Params         httprouter.Params
}

func (Context) JSON

func (c Context) JSON(v interface{}) error

type ErrHTTPResponse

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

func (ErrHTTPResponse) Error

func (err ErrHTTPResponse) Error() string

type IM

type IM map[interface{}]interface{}

type Router

type Router struct {
	*httprouter.Router
	// contains filtered or unexported fields
}

func New

func New() Router

func (Router) ErrHandler

func (r Router) ErrHandler(handle func(http.ResponseWriter, string, int))

func (Router) GET

func (r Router) GET(path string, handle func(Context) error)

func (Router) HEAD

func (r Router) HEAD(path string, handle func(Context) error)

func (Router) POST

func (r Router) POST(path string, handle func(Context) error)

Jump to

Keyboard shortcuts

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