Documentation
¶
Index ¶
- Constants
- Variables
- func IsBadRequest(err error) bool
- func IsConflict(err error) bool
- func IsForbidden(err error) bool
- func IsInternalServer(err error) bool
- func IsNotFound(err error) bool
- func IsUnauthorized(err error) bool
- func Status(err error) int
- type Error
- func BadRequest(code int, format string, args ...any) *Error
- func Conflict(code int, format string, args ...any) *Error
- func Forbidden(code int, format string, args ...any) *Error
- func FromError(err error) *Error
- func InternalServer(code int, format string, args ...any) *Error
- func New(status, code int, format string, args ...any) *Error
- func NotFound(code int, format string, args ...any) *Error
- func Unauthorized(code int, format string, args ...any) *Error
- func (e *Error) AppendMessage(format string, args ...any) *Error
- func (e *Error) AppendMetadata(metadata map[string]string) *Error
- func (e *Error) Error() string
- func (e *Error) GRPCStatus() *status.Status
- func (e *Error) Status() int
- func (e *Error) String() string
- func (e *Error) WithMetadata(metadata map[string]string) *Error
Constants ¶
View Source
const (
DefaultStatus = 200
)
Variables ¶
View Source
var ( UnknownStatus = 500 UnknownCode = 9999 )
Functions ¶
func IsBadRequest ¶
func IsConflict ¶
func IsForbidden ¶
func IsInternalServer ¶
func IsNotFound ¶
func IsUnauthorized ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.