Discover Packages
github.com/0RAJA/chat_app
src
model
common
package
Version:
v0.0.0-...-b89eba7
Opens a new window with list of versions in this module.
Published: Sep 26, 2022
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Decode 将json格式的数据解析到结构体,并进行校验
参数: data: json格式的数据,v: 绑定的结构体
返回: 错误信息
type List struct {
List interface{} `json:"list"`
Total int `json:"total"`
}
List 列表
type State struct {
Code int `json:"status_code"`
Msg string `json:"status_msg"`
Data interface{} `json:"data,omitempty"`
}
State 状态码
NewState 创建一个标准回复格式
参数: merr 错误信息(可为nil) datas 数据(存在只选择第一个值)
返回: 标准的回复格式结构
JsonStr 将结构体转换为json格式的数据,如果出错,则返回空json字符串
type Token struct {
Token string `json:"token"`
ExpiredAt time .Time `json:"expired_at"`
}
Token token
Source Files
¶
Click to show internal directories.
Click to hide internal directories.