package
1.0.18
Repository: https://github.com/ixugo/goweb.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
AuthMiddleware 鉴权.
WebCache 主要用于缓存静态资源 Cache-Control: max-age=3600 # 缓存1小时 Cache-Control: no-cache # 每次都需要验证 Cache-Control: no-store # 完全不缓存 Cache-Control: private # 只允许浏览器缓存 Cache-Control: public # 允许中间代理缓存.
CountGoroutines 协程数量,间隔 duration 记录一次.
No description provided by the author
Fail 通用错误返回.
GetBaseURL 提取请求地址 例如 http://127.0.0.1:8080/health 提取出 http://127.0.0.1:8080.
No description provided by the author
GetHost 提取主机 IP 或域名 例如 http://127.0.0.1:8080/health 提取出 127.0.0.1.
GetRole 获取用户角色.
GetUID 获取用户 ID.
GetUsername 获取用户名.
No description provided by the author
HandlerResponseMsg 获取响应的结果.
IPRateLimiter IP 限流器.
IPRateLimiter IP 限流器.
No description provided by the author
Logger 第二个参数是否记录 请求与响应的 body。.
Message 获取错误消息.
Metrics ...
No description provided by the author
NewError 创建自定义错误.
No description provided by the author
No description provided by the author
No description provided by the author
NewToken 创建 token.
NewValidator ...
No description provided by the author
ParseToken 解析 token.
RateLimiter 限流器.
No description provided by the author
Recover from panics and converts the panic to an error so it is reported in Metrics and handled in Errors.
SendChunk 发送分块数据.
SendChunkPro 高性能版.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Success 通用成功返回.
No description provided by the author
Unmarshal ...
WarpH 让函数更专注于业务,一般入参和出参应该是指针类型 没有入参时,应该使用 struct{}.

# Variables

业务错误.
待删除.
常用错误.
业务错误.
常用错误.
常用错误.
常用错误.
常用错误.
常用错误.
业务错误.
常用错误.
常用错误.
常用错误.
常用错误.
常用错误.
常用错误.
常用错误.

# Structs

No description provided by the author
Claims ...
DateFilter 日期区间过滤.
E 可反序列化的 err.
Error ...
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PageOutput 分页数据.
PagerFilter 分页过滤.
No description provided by the author
No description provided by the author
ScrollPager 滚动翻页.
SSE 发送事件 使用案例 http.HandleFunc("/stream", func(w http.ResponseWriter, r *http.Request) { sse := web.NewSSE(1024, time.Minute) go func(){ for range 3 { sse.Publish(web.Event{ ID: uuid.New().String(), Event: "ping", Data: []byte("pong"), }) time.Sleep(time.Second) } sse.Close() }() sse.ServeHTTP(w, r) }) */.
No description provided by the author
Validator 验证对象是否合法.

# Interfaces

Errorer ...
No description provided by the author
ResponseWriter ...

# Type aliases

No description provided by the author