1 // Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved.
2 // Revel Framework source code and usage is governed by a MIT style
3 // license that can be found in the LICENSE file.
7 // Filter type definition for Revel's filter
8 type Filter func(c *Controller, filterChain []Filter)
10 // Filters is the default set of global filters.
11 // It may be set by the application on initialization.
12 var Filters = []Filter{
13 PanicFilter, // Recover from panics and display an error page instead.
14 RouterFilter, // Use the routing table to select the right Action.
15 FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
16 ParamsFilter, // Parse parameters into Controller.Params.
17 SessionFilter, // Restore and write the session cookie.
18 FlashFilter, // Restore and write the flash cookie.
19 ValidationFilter, // Restore kept validation errors and save new ones from cookie.
20 I18nFilter, // Resolve the requested language.
21 InterceptorFilter, // Run interceptors around the action.
22 CompressFilter, // Compress the result.
24 ActionInvoker, // Invoke the action.
27 // NilFilter and NilChain are helpful in writing filter tests.
29 NilFilter = func(_ *Controller, _ []Filter) {}
30 NilChain = []Filter{NilFilter}