middleware

package
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Author: Landers Github: Landers1037 Date: 2020-02 Name: blog

Author: Landers Github: Landers1037 Date: 2020-03 Name: blog

Author: Landers Github: Landers1037 Date: 2020-03 Name: blog

Author: Landers Github: Landers1037 Date: 2020-03 Name: blog

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminAuth

func AdminAuth() gin.HandlerFunc

AdminAuth 在http情况下不能进行cookie同源传递 使用token验证

func AllowIe

func AllowIe() gin.HandlerFunc

AllowIe 如果是ie返回错误 仅拦截ie8-10 如需使用在ini配置中开启此项

func BlogLogger

func BlogLogger() gin.HandlerFunc

BlogLogger 自定义的日志器 默认同运行日志共享文件流

func Cache

func Cache(name string) interface{}

Cache 使用前置redis缓存

func CheckCache

func CheckCache(name string) string

CheckCache 检查是否命中缓存

func CheckToken

func CheckToken(c *gin.Context) bool

CheckToken 校验token是否符合规范

func Cors

func Cors() gin.HandlerFunc

Cors 开启跨域

func PostCache

func PostCache(p int) ([]response.RES_POST, int)

PostCache 文章列表的缓存

func PostView

func PostView() gin.HandlerFunc

PostView 文章开启阅读访问量统计 防止频繁写库 按时写入 防止并发场景下多次计时 采用每n分钟刷新机制

func SimpleAuth

func SimpleAuth() gin.HandlerFunc

SimpleAuth 简单校验只允许特定refer和host通过

func TryFile

func TryFile() gin.HandlerFunc

TryFile 模拟try file机制 对于使用前端处理路由的分离式设计程序使用 默认api的路由为本服务的 其他路由不由本服务处理

func Uv

func Uv() gin.HandlerFunc

Uv 防止内存碎片化 使用按时写入机制 每600s刷新一次

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL