Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

heirko/middleware

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
12 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

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.