http

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 13 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics added in v0.3.0

type Metrics interface {
	IncrementCounter(ctx context.Context, name string, labels ...string)
	DeltaUpDownCounter(ctx context.Context, name string, value float64, labels ...string)
	RecordHistogram(ctx context.Context, name string, value float64, labels ...string)
	SetGauge(name string, value float64)
}

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) GetClaims added in v1.1.1

func (r *Request) GetClaims() map[string]interface{}

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