gorilla

package
v2.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestServer

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

RestServer wraps gorilla mux router

func NewRestServer

func NewRestServer(data ...map[string]interface{}) *RestServer

NewRestServer create a RestServer instance

func (*RestServer) AddMiddleware

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

AddMiddleware adds middlewares to the end of chain

func (*RestServer) AddRoute

func (srv *RestServer) AddRoute(route ...rest.Route)

AddRoute adds routes to router

func (*RestServer) PreMiddleware

func (srv *RestServer) PreMiddleware(mwf ...func(http.Handler) http.Handler)

PreMiddleware adds middlewares to the head of chain

func (*RestServer) Run

func (srv *RestServer) Run()

Run runs http server

Jump to

Keyboard shortcuts

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