http

package
v0.0.0-...-958ca29 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

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

Request is an abstraction over the underlying http.Request. This abstraction is useful because it allows us to create applications without being aware of the transport. cmd.Request is another such abstraction.

func NewRequest

func NewRequest(r *http.Request) *Request

func (*Request) Bind

func (r *Request) Bind(i interface{}) error

func (*Request) Context

func (r *Request) Context() context.Context

func (*Request) Param

func (r *Request) Param(key string) string

func (*Request) PathParam

func (r *Request) PathParam(key string) string

type Responder

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

func NewResponder

func NewResponder(w http.ResponseWriter) *Responder

func (Responder) HTTPStatusFromError

func (r Responder) HTTPStatusFromError(err error) (int, interface{})

func (Responder) Respond

func (r Responder) Respond(data interface{}, err error)

type Router

type Router struct {
	mux.Router
}

func NewRouter

func NewRouter() *Router

func (*Router) Add

func (rou *Router) Add(method, pattern string, handler http.Handler)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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