Skip to content

nzqpeace/middleware

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repository information

This Repository contains all middleware for the Iris web framework.

You can contribute also, just make a pull request, try to keep conversion, configuration file: './mymiddleware/config.go' & middleware: './mymiddleware/mymiddleware.go'.

Middleware is just handler(s) which served before the main handler.

How can I install a middleware?

$ go get -u github.com/iris-contrib/middleware/$FOLDERNAME

NOTE: When you install one middleware you will have all of them downloaded & installed, no need to re-run the go get foreach middeware.

How can I register middleware?

To a single route

iris.Get("/mypath",myMiddleware1,myMiddleware2,func(ctx *iris.Context){}, func(ctx *iris.Context){},myMiddleware5,myMainHandlerLast)

To a party of routes or subdomain

myparty := iris.Party("/myparty", myMiddleware1,func(ctx *iris.Context){},myMiddleware3)
{
	//....
}

To all routes

iris.UseFunc(func(ctx *iris.Context){}, myMiddleware2)

To global, all routes on all subdomains on all parties

iris.MustUseFunc(func(ctx *iris.Context){}, myMiddleware2)

About

The middleware packages for the Iris web framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%