View definition

type FilterConfigurator

Defined in github.com/revel/revel/filterconfig.go

Description

FilterConfigurator allows the developer configure the filter chain on a per-controller or per-action basis. The filter configuration is applied by the FilterConfiguringFilter, which is itself a filter stage. For example,

Assuming:

Filters = []Filter{
  RouterFilter,
  FilterConfiguringFilter,
  SessionFilter,
  ActionInvoker,
}

Add:

FilterAction(App.Action).
  Add(OtherFilter)

=> RouterFilter, FilterConfiguringFilter, SessionFilter, OtherFilter, ActionInvoker

Remove:

FilterAction(App.Action).
  Remove(SessionFilter)

=> RouterFilter, FilterConfiguringFilter, OtherFilter, ActionInvoker

Insert:

FilterAction(App.Action).
  Insert(OtherFilter, revel.BEFORE, SessionFilter)

=> RouterFilter, FilterConfiguringFilter, OtherFilter, SessionFilter, ActionInvoker

Filter modifications may be combined between Controller and Action. For example:

 FilterController(App{}).
   Add(Filter1)
 FilterAction(App.Action).
   Add(Filter2)

.. would result in App.Action being filtered by both Filter1 and Filter2.

Note: the last filter stage is not subject to the configurator. In particular, Add() adds a filter to the second-to-last place.

FilterConfigurator is referenced in 1 repository

github.com/revel/revel