http

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 17

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) HostName

func (r *Request) HostName() string

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) (status int, errObj interface{})

func (Responder) Respond

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

type Router

type Router struct {
	mux.Router
}

func NewRouter

func NewRouter(c *container.Container) *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