Documentation
¶
Index ¶
- func Cors(headers ...string) gin.HandlerFunc
- func DefaultCors() gin.HandlerFunc
- func FailedBadRequest(ctx *gin.Context, msg string, data interface{})
- func FailedMessage(ctx *gin.Context, msg string)
- func FailedNotFound(ctx *gin.Context)
- func FailedServerError(ctx *gin.Context, msg string, data interface{})
- func Result(ctx *gin.Context, code int, msg string, data interface{})
- func ShouldBind(ctx *gin.Context, data interface{}) error
- func Success(ctx *gin.Context, msg string, data interface{})
- func SuccessData(ctx *gin.Context, data interface{})
- func SuccessDefault(ctx *gin.Context)
- func SuccessList(ctx *gin.Context, rows interface{})
- func SuccessPage(ctx *gin.Context, rows interface{}, page crud.PageData)
- type ApiInterface
- type BaseApi
- func (baseApi *BaseApi) HandleDelete(ctx *gin.Context)
- func (baseApi *BaseApi) HandleGet(ctx *gin.Context)
- func (baseApi *BaseApi) HandleInsert(ctx *gin.Context)
- func (baseApi *BaseApi) HandleList(ctx *gin.Context)
- func (baseApi *BaseApi) HandlePage(ctx *gin.Context)
- func (baseApi *BaseApi) HandleRemove(ctx *gin.Context)
- func (baseApi *BaseApi) HandleUpdate(ctx *gin.Context)
- func (baseApi *BaseApi) HandleUpdateStatus(ctx *gin.Context)
- type IdParams
- type UpdateStatusParams
- type WsConn
- type WsConnHandler
- type WsConnStatus
- type WsWorker
- type WsWorkerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cors ¶
func Cors(headers ...string) gin.HandlerFunc
func DefaultCors ¶
func DefaultCors() gin.HandlerFunc
func FailedBadRequest ¶
func FailedMessage ¶
func FailedNotFound ¶
func FailedServerError ¶
func ShouldBind ¶
func SuccessData ¶
func SuccessDefault ¶
func SuccessList ¶
Types ¶
type ApiInterface ¶
type ApiInterface interface { Result(ctx *gin.Context, code int, msg string, data interface{}) HandleGet(ctx *gin.Context) HandleInsert(ctx *gin.Context) HandleUpdate(ctx *gin.Context) HandleUpdateStatus(ctx *gin.Context) HandleDelete(ctx *gin.Context) HandleRemove(ctx *gin.Context) HandleList(ctx *gin.Context) HandlePage(ctx *gin.Context) }
type BaseApi ¶
type BaseApi struct {
Dao crud.DAOInterface
}
func (*BaseApi) HandleDelete ¶
func (*BaseApi) HandleInsert ¶
func (*BaseApi) HandleList ¶
func (*BaseApi) HandlePage ¶
func (*BaseApi) HandleRemove ¶
func (*BaseApi) HandleUpdate ¶
func (*BaseApi) HandleUpdateStatus ¶
type UpdateStatusParams ¶
type WsWorker ¶
type WsWorker struct { Router string Upgrader websocket.Upgrader OnConnected func(conn *WsConn) OnClosed func(conn *WsConn) OnError func(conn *WsConn, err error) OnAuth func(conn *WsConn) (map[string]interface{}, bool) OnMessage func(conn *WsConn, message []byte) ConnHandler WsConnHandler // contains filtered or unexported fields }
func HandleWebsocket ¶
func HandleWebsocket(router string, opts ...WsWorkerOption) (*WsWorker, error)
HandleWebsocket HandleWebsocket
type WsWorkerOption ¶
type WsWorkerOption func(*WsWorker)
WsWorkerOption WsWorkerOption
func WithUpgrader ¶
func WithUpgrader(up websocket.Upgrader) WsWorkerOption
WithUpgrader WithUpgrader
func WithWsHandler ¶
func WithWsHandler(handler WsConnHandler) WsWorkerOption
WithWsHandler WithWsHandler
Click to show internal directories.
Click to hide internal directories.