Documentation
¶
Index ¶
- Variables
- func Body(ctx *gin.Context, thenFunc noReqNoRespThenFunc)
- func BodyReq[REQ any](ctx *gin.Context, req REQ, thenFunc reqNoRespThenFunc[REQ])
- func BodyReqResp[REQ, RESP any](ctx *gin.Context, req REQ, thenFunc thenFunc[REQ, RESP])
- func BodyResp[RESP any](ctx *gin.Context, thenFunc noReqRespThenFunc[RESP])
- func BytesToString(b []byte) string
- func Cors() gin.HandlerFunc
- func Form(ctx *gin.Context, thenFunc noReqNoRespThenFunc)
- func FormReq[REQ any](ctx *gin.Context, req REQ, thenFunc reqNoRespThenFunc[REQ])
- func FormReqResp[REQ, RESP any](ctx *gin.Context, req REQ, thenFunc thenFunc[REQ, RESP])
- func FormResp[RESP any](ctx *gin.Context, thenFunc noReqRespThenFunc[RESP])
- func GetApp() *gin.Engine
- func GetAppWithGroup(prefix string) *gin.RouterGroup
- func MapFormWithTag(ptr any, form map[string][]string, tag string) error
- func Pagination[T any](db *gorm.DB, req PageReq, resp *PageResp[T]) (err error)
- func Pagination_other(db *gorm.DB, limit, page int, count *int64, list any) (err error)
- func Query(ctx *gin.Context, thenFunc noReqNoRespThenFunc)
- func QueryReq[REQ any](ctx *gin.Context, req REQ, thenFunc reqNoRespThenFunc[REQ])
- func QueryReqResp[REQ, RESP any](ctx *gin.Context, req REQ, thenFunc thenFunc[REQ, RESP])
- func QueryResp[RESP any](ctx *gin.Context, thenFunc noReqRespThenFunc[RESP])
- func SetBindParamError(code int, httpCode int)
- func SetServerError(code int, httpCode int)
- func StringToBytes(s string) []byte
- func UriEncode(ctx *gin.Context, thenFunc noReqNoRespThenFunc)
- func UriEncodeReq[REQ any](ctx *gin.Context, req REQ, thenFunc reqNoRespThenFunc[REQ])
- func UriEncodeReqResp[REQ, RESP any](ctx *gin.Context, req REQ, thenFunc thenFunc[REQ, RESP])
- func UriEncodeResp[RESP any](ctx *gin.Context, thenFunc noReqRespThenFunc[RESP])
- func WriteBindCodeSimple(httpCode int, ctx *gin.Context, str string)
- func WriteBindError(ctx *gin.Context, err error)
- func WriteJSON(ctx *gin.Context, code, httpCode int, msg string, err error, data any)
- func WriteJSONSimple(ctx *gin.Context, err error)
- func WriteServerErrorJSON(ctx *gin.Context, err error)
- func WriteSuccessJSON(ctx *gin.Context, data any)
- type Error
- type ID
- type IDs
- type PageReq
- type PageResp
Constants ¶
This section is empty.
Variables ¶
View Source
var (
FormUrlEncode = formUrlEncode{}
)
Functions ¶
func BodyReqResp ¶
func BytesToString ¶
BytesToString converts byte slice to string without a memory allocation.
func Cors ¶
func Cors() gin.HandlerFunc
func FormReqResp ¶
func GetAppWithGroup ¶
func GetAppWithGroup(prefix string) *gin.RouterGroup
func Pagination_other ¶ added in v1.0.6
func QueryReqResp ¶
func SetBindParamError ¶ added in v1.1.7
func SetServerError ¶ added in v1.1.7
func StringToBytes ¶
StringToBytes converts string to byte slice without a memory allocation.
func UriEncodeReq ¶ added in v1.1.1
func UriEncodeReqResp ¶ added in v1.1.1
func UriEncodeResp ¶ added in v1.1.1
func WriteBindError ¶
func WriteJSONSimple ¶
func WriteServerErrorJSON ¶
func WriteSuccessJSON ¶
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func NewErrorWithCode ¶
func NewErrorWithHttpCode ¶
Click to show internal directories.
Click to hide internal directories.