errors

package
v0.9.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Error

func Forbidden

func Forbidden(format string, v ...interface{}) *Error

Forbidden generates a 403 error.

func InternalServer

func InternalServer(format string, v ...interface{}) *Error

InternalServerError generates a 500 error.

func MethodNotAllowed

func MethodNotAllowed(format string, v ...interface{}) *Error

MethodNotAllowed generates a 405 error.

func New

func New(code int, message string) *Error

New

func NotFound

func NotFound(format string, v ...interface{}) *Error

NotFound generates a 404 error.

func Sprintf

func Sprintf(code int, format string, v ...interface{}) *Error

Sprintf 格式化输出

func Timeout

func Timeout(format string, v ...interface{}) *Error

Timeout generates a 408 error.

func Unauthorized

func Unauthorized(format string, v ...interface{}) *Error

Unauthorized generates a 401 error.

func (*Error) Error

func (e *Error) Error() string

Error string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL