Documentation
¶
Index ¶
- type Exception
- func (e *Exception) BadRequest(args ...any) services.Exception
- func (e *Exception) Error() string
- func (e *Exception) Forbidden(args ...any) services.Exception
- func (e *Exception) Get(field string) (any, error)
- func (e *Exception) MethodNotAllowed(args ...any) services.Exception
- func (e *Exception) New(code int, args ...any) services.Exception
- func (e *Exception) NotAcceptable(args ...any) services.Exception
- func (e *Exception) NotFound(args ...any) services.Exception
- func (e *Exception) RequestEntityTooLarge(args ...any) services.Exception
- func (e *Exception) RequestTimeout(args ...any) services.Exception
- func (e *Exception) RequestURITooLong(args ...any) services.Exception
- func (e *Exception) Set(arg any) services.Exception
- func (e *Exception) TooManyRequests(args ...any) services.Exception
- func (e *Exception) Unauthorized(args ...any) services.Exception
- func (e *Exception) UnprocessableEntity(args ...any) services.Exception
- func (e *Exception) UnsupportedMediaType(args ...any) services.Exception
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exception ¶
type Exception struct { *exception.Service `json:"-"` Code int `json:"code"` Msg string `json:"msg"` Data any `json:"data"` }
Exception 异常响应体
func (*Exception) BadRequest ¶
BadRequest 400 通用异常请求
func (*Exception) MethodNotAllowed ¶
MethodNotAllowed 405 请求方法不可行
func (*Exception) NotAcceptable ¶
NotAcceptable 406 不可接受的请求
func (*Exception) RequestEntityTooLarge ¶
RequestEntityTooLarge 413 请求实体太大
func (*Exception) RequestTimeout ¶
RequestTimeout 408 请求超时
func (*Exception) RequestURITooLong ¶
RequestURITooLong 414 请求 URL 太长
func (*Exception) TooManyRequests ¶
TooManyRequests 429 过多的请求
func (*Exception) Unauthorized ¶
Unauthorized 401 未授权的请求
func (*Exception) UnprocessableEntity ¶
UnprocessableEntity 422 请求参数错误
Click to show internal directories.
Click to hide internal directories.