Documentation ¶
Overview ¶
@APIVersion 1.0.0 @Title beego Test API @Description beego has a very cool tools to autogenerate documents for your API @Contact astaxie@gmail.com @TermsOfServiceUrl http://beego.me/ @License Apache 2.0 @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FilterUser = func(ctx *context.Context) { req := ctx.Request requestURI := req.RequestURI method := req.Method if ((method == "GET" && len(requestURI) >= 13 && (requestURI[:13] == "/api/v1/proms" || requestURI[:13] == "/api/v1/rules")) || (method == "POST" && len(requestURI) >= 14 && requestURI[:14] == "/api/v1/alerts")) && ctx.Input.Header("Token") == "96smhbNpRguoJOCEKNrMqQ" { return } if len(requestURI) >= 14 && requestURI[:14] == "/api/v1/logout" { return } username, _ := ctx.Input.Session("username").(string) if username == "" && ctx.Request.RequestURI[:13] != "/api/v1/login" { _ = ctx.Output.JSON(common.Res{Code: -1, Msg: "Unauthorized"}, false, false) } }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.