httpsimple

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: Apache-2.0 Imports: 10 Imported by: 4

README

httpsimple

Go library for simple HTTP servers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicHandler

func BasicHandler(handler func(request *http.Request) CanHTTPWrite, l *zapctx.Logger) http.Handler

func BasicServerRun

func BasicServerRun(logger *zapctx.Logger, server *http.Server, onListen func(listener net.Listener), addr string) error

func HealthHandler

func HealthHandler(z *zapctx.Logger, tracer gotracing.Tracing) http.Handler

func LogMiddleware

func LogMiddleware(logger *zapctx.Logger, filterFunc func(req *http.Request) bool) func(handler http.Handler) http.Handler

func MuxMiddleware

func MuxMiddleware() func(handler http.Handler) http.Handler

func NotFoundHandler

func NotFoundHandler(logger *zapctx.Logger) http.Handler

Types

type BasicResponse

type BasicResponse struct {
	Code    int
	Msg     io.WriterTo
	Headers map[string]string
}

func (*BasicResponse) HTTPWrite

func (g *BasicResponse) HTTPWrite(ctx context.Context, w http.ResponseWriter, l *zapctx.Logger)

type CanHTTPWrite

type CanHTTPWrite interface {
	HTTPWrite(ctx context.Context, w http.ResponseWriter, l *zapctx.Logger)
}

Jump to

Keyboard shortcuts

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