Documentation ¶
Index ¶
- Constants
- func Abort(ctx *fiber.Ctx, code int)
- func AbortJSON(ctx *fiber.Ctx, code int, body interface{})
- func AccessDenied(ctx *fiber.Ctx, msg string)
- func ConcatWith(master, slave string) string
- func GetAnonymousOpenUrls() (urls []string)
- func GetLimitedBlackListUrls() (urls []string)
- func GetLimitedWhiteListUrls() (urls []string)
- func GetRegularPermissionUrls(ctx *fiber.Ctx) (urls []string)
- func GetSuperPermissionUrls(ctx *fiber.Ctx) (urls []string)
- func GetUserType(ctx *fiber.Ctx) (int, error)
- func InStringList(x string, lst []string, cmp int) bool
- func IsStaticResourceUrl(url string) bool
- func QueryDefault(ctx *fiber.Ctx, key, val string) (value string)
- func RemoveSpaces(s string) string
- func WrapWith(s, left, right string) string
Constants ¶
View Source
const ( USER_ANONYMOUS = iota // 匿名用户(未登录/未注册) USER_FORBIDDEN // 封禁用户(有违规被封号) USER_LIMITED // 受限用户(未过审或被降级) USER_REGULAR // 正常用户(正式会员) USER_SUPER // 超级用户(后台管理权限) )
用户分类
View Source
const ( CMP_STRING_OMIT = iota // 不比较 CMP_STRING_CONTAINS // 包含 CMP_STRING_STARTSWITH // 打头 CMP_STRING_ENDSWITH // 结尾 CMP_STRING_IGNORE_SPACES // 忽略空格 CMP_STRING_CASE_INSENSITIVE // 不分大小写 CMP_STRING_EQUAL // 相等 )
字符串比较方式
Variables ¶
This section is empty.
Functions ¶
func GetLimitedBlackListUrls ¶
func GetLimitedBlackListUrls() (urls []string)
获取受限用户黑名单中的的网址,与白名单二选一
func GetLimitedWhiteListUrls ¶
func GetLimitedWhiteListUrls() (urls []string)
获取受限用户白名单中的的网址,不再检查正常用户权限,与黑名单二选一
func GetRegularPermissionUrls ¶
获取正常用户权限可访问的网址
func GetSuperPermissionUrls ¶
获取超级用户权限可访问的网址,不再检查正常用户权限
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.