base

package
v0.0.0-...-ceb20fc Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalMiddleware []mux.MiddlewareFunc

This is a middleware of any route.

View Source
var Routes []Route

Save all router.

Functions

func CORS

func CORS(handler http.Handler) http.Handler

func Index

func Index(w http.ResponseWriter, _ *http.Request)

Index is displaying all API.

func Logger

func Logger(handler http.Handler, name string) http.Handler

func Test

func Test(w http.ResponseWriter, r *http.Request)

Types

type Route

type Route struct {
	Name        string               `json:"name"`
	Method      string               `json:"method"`
	Pattern     string               `json:"pattern"`
	HandlerFunc http.HandlerFunc     `json:"-"`
	Middleware  []mux.MiddlewareFunc `json:"-"`
}

func (*Route) InitMiddleware

func (route *Route) InitMiddleware()

InitMiddleware use to fresh middleware.

Jump to

Keyboard shortcuts

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