server

package
v0.0.0-...-cf4d00b Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMonitorWrapper = func(path string, handler http.Handler) http.Handler {
	return handler
}

Functions

func ActionErrorHandler

func ActionErrorHandler(handler ActionHandler) http.Handler

Types

type ActionHandler

type ActionHandler func(w http.ResponseWriter, req *http.Request) error

type Config

type Config func(server *Server)

func WithMonitorWrapper

func WithMonitorWrapper(wrapper MonitorWrapper) Config

type MonitorWrapper

type MonitorWrapper func(path string, handler http.Handler) http.Handler

type Route

type Route struct {
	Path    string
	Method  string
	Handler http.Handler
}

type Server

type Server struct {
	http.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(configs ...Config) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context, handlers ...ShutdownHandler) error

func (*Server) Route

func (s *Server) Route(r Route)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ShutdownHandler

type ShutdownHandler func(ctx context.Context) error

Jump to

Keyboard shortcuts

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