resps

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParameterError   = "Parameter error"   // 参数错误
	MissingParameter = "Missing parameter" // 缺少参数
	TargetNotFound   = "Target not found"  // 目标不存在
	OK               = "OK"                // 操作成功
	PermissionDenied = "PermissionDenied"  // 权限不足
	UnauthorizedText = "Unauthorized"      // 未授权
	InternalError    = "Internal error"
)

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(c *app.RequestContext, message string)

func Custom

func Custom(c *app.RequestContext, code int, message string, data ...map[string]any)

Custom 自定义响应

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 Ok

func Ok(c *app.RequestContext, message string, data ...map[string]any)

func Redirect

func Redirect(c *app.RequestContext, url string)

Redirect 3xx for oidc

func RespMessageWithError

func RespMessageWithError(message string, err error) string

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL