model

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrorBadRequest
	ErrorBadRequest = 400
	// ErrorUnauthorized
	ErrorUnauthorized = 401
	// ErrorForbidden
	ErrorForbidden = 403
	// ErrorNotFound
	ErrorNotFound = 404
	// ErrorInternalServer
	ErrorInternalServer = 500
	// ErrorNotImplemented
	ErrorNotImplemented = 501
)

Variables

This section is empty.

Functions

func ErrorBadRequestStatus

func ErrorBadRequestStatus(message string) []byte

ErrorBadRequestStatus

func ErrorForbiddenStatus

func ErrorForbiddenStatus(message string) []byte

ErrorForbiddenStatus

func ErrorInternalServerStatus

func ErrorInternalServerStatus(message string) []byte

ErrorInternalServerStatus

func ErrorNotFoundStatus

func ErrorNotFoundStatus(message string) []byte

ErrorNotFoundStatus

func ErrorNotImplementedStatus

func ErrorNotImplementedStatus(message string) []byte

ErrorNotImplementedStatus

func ErrorUnauthorizedStatus

func ErrorUnauthorizedStatus(message string) []byte

ErrorUnauthorizedStatus

func HttpError

func HttpError(res *restful.Response, code int, format string, a ...interface{}) error

func NewNotFoundError

func NewNotFoundError(msg string) error

Types

type ErrorSpec

type ErrorSpec struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

ErrorSpec describes Detailed HTTP error response, which consists of a HTTP status code, and a custom error message unique for each failure case.

type NotFoundError

type NotFoundError struct {
	S string
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type NotImplementError

type NotImplementError struct {
	S string
}

Volume group error

func (*NotImplementError) Error

func (e *NotImplementError) Error() string

Jump to

Keyboard shortcuts

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