errors

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error_Auth_Path_NotFound  = New(http.StatusNotFound, "auth path not found")
	Error_Auth_Miss_Token     = New(http.StatusUnauthorized, "miss token")
	Error_Auth_Invalid_Token  = New(http.StatusUnauthorized, "invalid token")
	Error_Auth_Host_Not_Match = New(http.StatusUnauthorized, "host not match")
	Error_Auth_No_Perm        = New(http.StatusUnauthorized, "no permission")
)

Functions

This section is empty.

Types

type ApiError

type ApiError interface {
	GetStatus() int
	error
}

func New

func New(status int, msg string) ApiError

func PkgError

func PkgError(status int, err error) ApiError

type ApiErrorHandler

type ApiErrorHandler interface {
	SetApiErrorHandler(GinApiErrorHandler)
}

type CommonApiErrorHandler

type CommonApiErrorHandler struct {
	GinApiErrorHandler
}

func (*CommonApiErrorHandler) SetApiErrorHandler

func (api *CommonApiErrorHandler) SetApiErrorHandler(handler GinApiErrorHandler)

type GinApiErrorHandler

type GinApiErrorHandler func(c *gin.Context, err error)

type GinServerErrorHandler

type GinServerErrorHandler func(c *gin.Context, service string, err error)

Jump to

Keyboard shortcuts

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