ddhttp

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChiHttpSrv

type ChiHttpSrv struct {
	*chi.Mux
	// contains filtered or unexported fields
}

TODO https://github.com/go-chi/chi

type DefaultHttpSrv

type DefaultHttpSrv struct {
	*mux.Router
	// contains filtered or unexported fields
}

gorilla

func (*DefaultHttpSrv) AddMiddleware

func (srv *DefaultHttpSrv) AddMiddleware(mwf ...func(http.Handler) http.Handler)

func (*DefaultHttpSrv) AddRoute

func (srv *DefaultHttpSrv) AddRoute(route ...Route)

func (*DefaultHttpSrv) Run

func (srv *DefaultHttpSrv) Run()

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Srv

type Srv interface {
	// Run the service
	Run()
	// Register routes
	AddRoute(route ...Route)
	// Use middleware
	AddMiddleware(mwf ...func(http.Handler) http.Handler)
}

func NewDefaultHttpSrv

func NewDefaultHttpSrv() Srv

Jump to

Keyboard shortcuts

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