{"modulePath":"github.com/94peter/api-toolkit","version":"v1.7.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Variables\n\n```go\nvar (\n\tError_Auth_Path_NotFound  = New(http.StatusNotFound, \"auth path not found\")\n\tError_Auth_Miss_Token     = New(http.StatusUnauthorized, \"miss token\")\n\tError_Auth_Invalid_Token  = New(http.StatusUnauthorized, \"invalid token\")\n\tError_Auth_Host_Not_Match = New(http.StatusUnauthorized, \"host not match\")\n\tError_Auth_No_Perm        = New(http.StatusUnauthorized, \"no permission\")\n)\n```\n\n## Types\n\n```go\ntype ApiError interface {\n\tGetStatus() int\n\terror\n}\n```\n\n```go\nfunc New(status int, msg string) ApiError\n```\n\n```go\nfunc PkgError(status int, err error) ApiError\n```\n\n```go\ntype ApiErrorHandler interface {\n\tSetApiErrorHandler(GinApiErrorHandler)\n}\n```\n\n```go\ntype CommonApiErrorHandler struct {\n\tGinApiErrorHandler\n}\n```\n\n```go\nfunc (api *CommonApiErrorHandler) SetApiErrorHandler(handler GinApiErrorHandler)\n```\n\n```go\ntype GinApiErrorHandler func(c *gin.Context, err error)\n```\n\n```go\ntype GinServerErrorHandler func(c *gin.Context, service string, err error)\n```\n\n","path":"github.com/94peter/api-toolkit/errors","name":"errors","synopsis":"","isRedistributable":true}
