Documentation ¶
Index ¶
- Variables
- func AbortWithError(c *gin.Context, err error)
- func ErrorHandleMiddleware() gin.HandlerFunc
- func LogJson(level LogLevel, jsonMap map[string]interface{})
- type HttpError
- func NewBadRequestError(message string) HttpError
- func NewBadRequestErrorFromError(err error) HttpError
- func NewHiddenHttpError(statusCode int, message string) HttpError
- func NewHiddenHttpErrorWithRelatedError(statusCode int, message string, err error) HttpError
- func NewHttpError(statusCode int, message string) HttpError
- func NewHttpErrorWithRelatedError(statusCode int, message string, err error) HttpError
- func NewInternalServerError(err error) HttpError
- type Log
- func (l *Log) Error(_ context.Context, msg string, data ...interface{})
- func (l *Log) Fatal(v ...interface{})
- func (l *Log) Fatalf(format string, args ...interface{})
- func (l *Log) Fatalln(message string)
- func (l *Log) Info(_ context.Context, msg string, data ...interface{})
- func (l *Log) LogMode(level logger.LogLevel) logger.Interface
- func (l *Log) Print(v ...interface{})
- func (l *Log) Printf(format string, args ...interface{})
- func (l *Log) Println(message string)
- func (l *Log) Trace(_ context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l *Log) Warn(_ context.Context, msg string, data ...interface{})
- func (l *Log) Warnf(format string, args ...interface{})
- func (l *Log) Warnln(message string)
- type LogLevel
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotFound = NewHttpError(http.StatusNotFound, "user not found") ErrUrlUsernameNotMatchHeader = NewHttpError(http.StatusUnprocessableEntity, "the URL username did not match the Authorization header username") )
View Source
var (
Logger = New()
)
Functions ¶
func AbortWithError ¶
func ErrorHandleMiddleware ¶
func ErrorHandleMiddleware() gin.HandlerFunc
Types ¶
type HttpError ¶
func NewBadRequestError ¶
func NewHiddenHttpError ¶
func NewHttpError ¶
func NewInternalServerError ¶
Click to show internal directories.
Click to hide internal directories.