Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UseEncrypted = false AesKey = "gscafflod-rest" )
加密通信使用, 一般 app 中需要. 本工具尚未支持.
Functions ¶
func NewGinRouter ¶
Types ¶
type HTTPBundle ¶
type HTTPBundle struct {
// contains filtered or unexported fields
}
func (*HTTPBundle) GetName ¶
func (bundle *HTTPBundle) GetName() string
func (*HTTPBundle) LoadDefault ¶
func (bundle *HTTPBundle) LoadDefault()
func (*HTTPBundle) Run ¶
func (bundle *HTTPBundle) Run(ctx context.Context)
func (*HTTPBundle) Stop ¶
func (bundle *HTTPBundle) Stop(ctx context.Context)
type IDRequest ¶
type IDRequest struct {
ID int64 `uri:"id" form:"id" json:"id" binding:"required"`
}
IDRequest 简单封装一个只有 id 参数的请求体.
type IDRequestString ¶
type IDRequestString struct {
ID string `json:"id"`
}
func (*IDRequestString) Validate ¶
func (req *IDRequestString) Validate() error
type IDRequestUint ¶
type IDRequestUint struct {
ID uint64 `json:"id"`
}
func (*IDRequestUint) Validate ¶
func (req *IDRequestUint) Validate() error
type Option ¶
type Option func(bundle *HTTPBundle)
func OptionPort ¶
func OptionReadTimeout ¶
func OptionTimeout ¶
func OptionWriteTimeout ¶
type PageBaseRequest ¶
type PageBaseRequest struct { Limit int `form:"limit" json:"limit"` Offset int `form:"offset" json:"offset"` LastID int64 `form:"last_id" json:"last_id"` Order string `form:"order" json:"order"` // default desc. OrderBy string `form:"order_by" json:"order_by"` // default id }
func (*PageBaseRequest) LoadDefault ¶
func (req *PageBaseRequest) LoadDefault()
type PageBaseResponse ¶
type PageBaseResponse struct { Total int `json:"total"` Records interface{} `json:"records"` LastID interface{} `json:"last_id"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.