Documentation
¶
Index ¶
Constants ¶
View Source
const ( ContentDispositionHeaderKey = "Content-Disposition" ContentDispositionHeaderValueFormat = `attachment; filename="%s"` )
header相关
Variables ¶
This section is empty.
Functions ¶
func MakeCookie ¶
func MakeCookie(userID int, co CookieOption) (cookie http.Cookie, err error)
MakeCookie 新建令牌
Types ¶
type Content ¶
type Content struct {
ContentLength int64 `json:"-"`
ContentType string `json:"-"`
ContentReader io.Reader `json:"-"`
ExtraHeaders map[string]string `json:"-"`
}
Content 内容
func MakeContentFromBuffer ¶
MakeContentFromBuffer 新建内容
type CookieOption ¶
type HandlerFunc ¶
HandlerFunc 处理函数 使用别名,可以互相替换,但是不能添加方法 使用类型,不可以互相替换,需要转型,但是可以添加方法
type RegisterOption ¶
type Result ¶
type Result struct {
utilerrors.Error
Data interface{} `json:"data"` // 正常返回时的数据
// 给登陆接口使用
CookieAfterLogin int `json:"-"` // 登陆时需要设置登陆态的用户信息
// 时间戳
Timestamp int64 `json:"timestamp"`
// 请求ID,在请求到来时生成,处理过程传递,返回时一并返回
RequestID string `json:"requestID"` // uuid
// 下载内容时使用
Content
}
Result 结果
func (*Result) PresentData ¶
PresentData 用具体结构体展现数据
Click to show internal directories.
Click to hide internal directories.