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