Documentation
¶
Index ¶
- Constants
- func BadRequest(c *app.RequestContext, message string)
- func Custom(c *app.RequestContext, code int, message string, data ...map[string]any)
- func ErrorPage(c *app.RequestContext, template *ErrorPageTemplate)
- func Forbidden(c *app.RequestContext, message string)
- func InternalServerError(c *app.RequestContext, message string)
- func NotFound(c *app.RequestContext, message string)
- func Ok(c *app.RequestContext, message string, data ...map[string]any)
- func Redirect(c *app.RequestContext, url string)
- func RespMessageWithError(message string, err error) string
- func ServiceUnavailable(c *app.RequestContext, message string)
- func Unauthorized(c *app.RequestContext, message string)
- type ErrorPageTemplate
Constants ¶
View Source
const ( ParameterError = "Parameter error" // 参数错误 MissingParameter = "Missing parameter" // 缺少参数 TargetNotFound = "Target not found" // 目标不存在 OK = "OK" // 操作成功 PermissionDenied = "PermissionDenied" // 权限不足 InternalError = "Internal error" )
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(c *app.RequestContext, message string)
func ErrorPage ¶
func ErrorPage(c *app.RequestContext, template *ErrorPageTemplate)
func Forbidden ¶
func Forbidden(c *app.RequestContext, message string)
func InternalServerError ¶
func InternalServerError(c *app.RequestContext, message string)
func NotFound ¶
func NotFound(c *app.RequestContext, message string)
func RespMessageWithError ¶
func ServiceUnavailable ¶
func ServiceUnavailable(c *app.RequestContext, message string)
func Unauthorized ¶
func Unauthorized(c *app.RequestContext, message string)
Types ¶
type ErrorPageTemplate ¶
type ErrorPageTemplate struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.