Documentation ¶
Index ¶
- Constants
- func AbortJSON(ctx *gin.Context, statusCode int, verdict string, message string, ...)
- func Recovery() gin.HandlerFunc
- func RequestIDMiddleware() gin.HandlerFunc
- func SendError(ctx *gin.Context, _ error)
- func SendJSON(ctx *gin.Context, statusCode int, verdict string, message string, ...)
- func SendSuccess(ctx *gin.Context, message string, data interface{})
- type App
- type AppOption
- type StubRequestParam
Constants ¶
View Source
const ( VerdictSuccess = "success" VerdictFailure = "failure" VerdictMissingParameters = "missing_parameters" VerdictInvalidParameters = "invalid_parameters" )
Variables ¶
This section is empty.
Functions ¶
func Recovery ¶
func Recovery() gin.HandlerFunc
Recovery returns a middleware for a given writer that recovers from any panics and calls the provided handle func to handle it
func RequestIDMiddleware ¶
func RequestIDMiddleware() gin.HandlerFunc
RequestIDMiddleware adds X-Request-ID value to request, response and save to context variable
func SendSuccess ¶
SendSuccess sends success response
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App defines app interface
type StubRequestParam ¶
type StubRequestParam struct { Stubs []*rio.Stub `json:"stubs" yaml:"stubs"` // Go SDK expect the response should be encoded data ReturnEncoded bool `json:"return_encoded" yaml:"return_encoded"` }
StubRequestParam stub request
Click to show internal directories.
Click to hide internal directories.