rest_err

package
v0.0.0-...-be2730d Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Causes

type Causes struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

type RestErr

type RestErr struct {
	Message string   `json:"message"`
	Err     string   `json:"error"`
	Code    int      `json:"code"`
	Causes  []Causes `json:"causes"`
}

func NewBadRequestError

func NewBadRequestError(message string) *RestErr

func NewBadRequestValidationError

func NewBadRequestValidationError(message string, causes []Causes) *RestErr

func NewForbiddenError

func NewForbiddenError(message string) *RestErr

func NewInternalServerError

func NewInternalServerError(message string) *RestErr

func NewNotFoundError

func NewNotFoundError(message string) *RestErr

func NewRestErr

func NewRestErr(message, err string, code int, causes []Causes) *RestErr

func NewUnauthorizedError

func NewUnauthorizedError(message string) *RestErr

func (*RestErr) Error

func (r *RestErr) Error() string

Jump to

Keyboard shortcuts

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