resterrors

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: Apache-2.0 Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestErr

type RestErr interface {
	Message() string
	Status() int
	Error() string
	Causes() []interface{}
}

RestErr is the base structure for error responses

func NewBadRequestError

func NewBadRequestError(message string) RestErr

NewBadRequestError is used to create a RestErr informing a BadRequest and a message.

func NewInternalServerError

func NewInternalServerError(message string, err error) RestErr

NewInternalServerError is used to create a RestErr informing a InternalServerError, a message, and an error as cause.

func NewNoContentError added in v1.0.13

func NewNoContentError(message string) RestErr

NewNoContentError is used to create a RestErr informing a No Content and a message.

func NewNotFoundError

func NewNotFoundError(message string) RestErr

NewNotFoundError is used to create a RestErr informing a NotFound and a message.

func NewRestError

func NewRestError(message string, status int, err string, causes []interface{}) RestErr

NewRestError is the function to create a new RestError.

func NewRestErrorFromBytes

func NewRestErrorFromBytes(bytes []byte) (RestErr, error)

NewRestErrorFromBytes is the function to create a new RestError from bytes.

func NewUnauthorizedError added in v1.0.8

func NewUnauthorizedError(message string) RestErr

NewUnauthorizedError is used to create a RestErr informing a Unauthorized and a message.

Jump to

Keyboard shortcuts

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