zin

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 5 Imported by: 0

README

zin

Zin is a toolbox for httprouter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapF

func WrapH

func WrapH(h http.Handler) httprouter.Handle

Types

type Middleware

type Middleware func(httprouter.Handle) httprouter.Handle

func WrapM

func WrapM(sm StdFuncMiddlware) Middleware

func WrapS

func WrapS(sm StdMiddlware) Middleware

type MuxGroup

type MuxGroup struct {
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup(basePath string, middlewares ...Middleware) *MuxGroup

func (*MuxGroup) Group

func (g *MuxGroup) Group(path string, middlewares ...Middleware) *MuxGroup

Group returns new MuxGroup with appending inputs middlewares to the end of current muxgroup's middleware

func (*MuxGroup) NotFound

func (g *MuxGroup) NotFound(h http.Handler) http.Handler

func (*MuxGroup) Pack

func (g *MuxGroup) Pack(path string, middlewares ...Middleware) *MuxGroup

Pack returns new MuxGroup with appending current muxgroup's middlewares to the end of input middlewarse

func (*MuxGroup) Path

func (g *MuxGroup) Path(p string) string

func (*MuxGroup) R

func (g *MuxGroup) R(r RegisterFunc, p string, handle httprouter.Handle)

func (*MuxGroup) Use

func (g *MuxGroup) Use(middlewares ...Middleware)

Deprecated. Use Group or Pack. https://stackoverflow.com/questions/53572736/append-to-a-new-slice-affect-original-slice

type RegisterFunc

type RegisterFunc func(path string, handle httprouter.Handle)

type StdFuncMiddlware

type StdFuncMiddlware func(http.HandlerFunc) http.HandlerFunc

type StdMiddlware

type StdMiddlware func(http.Handler) http.Handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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