Filter

Variables

var (
    NilFilter = func(_ *Controller, _ []Filter) {}
    NilChain  = []Filter{NilFilter}
)

NilFilter and NilChain are helpful in writing filter tests.

var Filters = []Filter{
    PanicFilter,
    RouterFilter,
    FilterConfiguringFilter,
    ParamsFilter,
    SessionFilter,
    FlashFilter,
    ValidationFilter,
    I18nFilter,
    InterceptorFilter,
    CompressFilter,
    ActionInvoker,
}

Filters is the default set of global filters. It may be set by the application on initialization.

type Filter

type Filter func(c *Controller, filterChain []Filter)