Documentation ¶
Index ¶
- Constants
- Variables
- func Created(c *gin.Context, data interface{})
- func Forbidden(c *gin.Context, data interface{})
- func NoContent(c *gin.Context, data interface{})
- func NotOK(c *gin.Context, err error)
- func OK(c *gin.Context, data interface{})
- func Response(c *gin.Context, code int, msg string, data interface{})
- func Unauthorized(c *gin.Context, data interface{})
- type ClusterIsolatedSwitch
- type IsolatedSwitch
- type PageData
- type PageFilterFunc
- type PageQueryCond
- type PageSortFunc
- type QArgs
- type ResponseStruct
- type URLQuery
- func (q *URLQuery) Count(db *gorm.DB, cond *PageQueryCond) (total int64, err error)
- func (q *URLQuery) MustPreload(mustpreloads []string) *URLQuery
- func (q *URLQuery) PageList(db *gorm.DB, cond *PageQueryCond, dest interface{}) (total int64, page, size int64, err error)
- func (q *URLQuery) PageQuery(db *gorm.DB, cond *PageQueryCond) *gorm.DB
- func (q *URLQuery) PageResponse(data interface{}) interface{}
Constants ¶
View Source
const ( MessageOK = "ok" MessageNotFound = "not found" MessageError = "err" MessageForbidden = "forbidden" )
Variables ¶
Functions ¶
func Unauthorized ¶
Types ¶
type ClusterIsolatedSwitch ¶
type ClusterIsolatedSwitch struct { Isolate bool `json:"isolate"` ClusterID uint `json:"cluster_id" binding:"required"` }
网络隔离用到的数据结构
type IsolatedSwitch ¶
type IsolatedSwitch struct {
Isolate bool `json:"isolate"`
}
type PageData ¶
func NewPageData ¶
func NewPageData(list interface{}, page, size int, filterfn PageFilterFunc, sortfn PageSortFunc) PageData
func NewPageDataFromContext ¶
func NewPageDataFromContext(c *gin.Context, fulllist interface{}, pick PageFilterFunc, sortfn PageSortFunc) PageData
type PageFilterFunc ¶
type PageQueryCond ¶
type PageSortFunc ¶
type ResponseStruct ¶
type ResponseStruct struct { Message string Data interface{} ErrorData interface{} }
type URLQuery ¶
type URLQuery struct { Page string `form:"page"` Size string `form:"size"` Order string `form:"order"` Search string `form:"search"` Preload string `form:"preload"` // contains filtered or unexported fields }
func NewURLQuery ¶
func (*URLQuery) MustPreload ¶
func (*URLQuery) PageResponse ¶
func (q *URLQuery) PageResponse(data interface{}) interface{}
Click to show internal directories.
Click to hide internal directories.