Documentation ¶
Index ¶
- func ErrResp(e error) (httpendpoints.Responser, error)
- func ErrWrite(e error, w http.ResponseWriter) error
- func IsNotFound(e error) bool
- type APIError
- func (e *APIError) AccessDenied() *APIError
- func (e *APIError) AlreadyExists() *APIError
- func (e *APIError) Code() string
- func (e *APIError) Error() string
- func (e *APIError) ErrorVerificationCode(err error) *APIError
- func (e *APIError) HTTPCode() int
- func (e *APIError) InternalError(err error) *APIError
- func (e *APIError) InvalidParameter(err interface{}) *APIError
- func (e *APIError) InvalidState(err string) *APIError
- func (e *APIError) MissingParameter(err string) *APIError
- func (e *APIError) NotFound() *APIError
- func (e *APIError) NotLogin() *APIError
- func (e *APIError) Render(localeResource i18n.LocaleResource) string
- func (e *APIError) ToResp() httpendpoints.Responser
- func (e *APIError) Write(w http.ResponseWriter) error
- type MetaMessage
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
// contains filtered or unexported fields
}
APIError .
func (*APIError) ErrorVerificationCode ¶
ErrorVerificationCode .
func (*APIError) InternalError ¶
InternalError .
func (*APIError) InvalidParameter ¶
InvalidParameter .
func (*APIError) InvalidState ¶
InvalidState .
func (*APIError) MissingParameter ¶
MissingParameter .
func (*APIError) Render ¶
func (e *APIError) Render(localeResource i18n.LocaleResource) string
Render .
func (*APIError) ToResp ¶
func (e *APIError) ToResp() httpendpoints.Responser
ToResp 根据 APIError 转为一个 http error response.
type MetaMessage ¶
MetaMessage .
type Option ¶
type Option func(*APIError)
Option 可选参数
func WithTemplateMessage ¶
WithTemplateMessage .
Click to show internal directories.
Click to hide internal directories.