1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-13 16:21:03 +00:00

Deprecated old web module

This commit is contained in:
Ming Deng
2020-08-05 21:57:20 +08:00
parent 02972d8702
commit 882aa9b967
17 changed files with 258 additions and 0 deletions

View File

@ -17,11 +17,13 @@ package beego
import "github.com/astaxie/beego/context"
// FilterFunc defines a filter function which is invoked before the controller handler is executed.
// Deprecated: using pkg/, we will delete this in v2.1.0
type FilterFunc func(*context.Context)
// FilterRouter defines a filter operation which is invoked before the controller handler is executed.
// It can match the URL against a pattern, and execute a filter function
// when a request with a matching URL arrives.
// Deprecated: using pkg/, we will delete this in v2.1.0
type FilterRouter struct {
filterFunc FilterFunc
tree *Tree
@ -33,6 +35,7 @@ type FilterRouter struct {
// ValidRouter checks if the current request is matched by this filter.
// If the request is matched, the values of the URL parameters defined
// by the filter pattern are also returned.
// Deprecated: using pkg/, we will delete this in v2.1.0
func (f *FilterRouter) ValidRouter(url string, ctx *context.Context) bool {
isOk := f.tree.Match(url, ctx)
if isOk != nil {