errx

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Status    int    `json:"status"`
	Error     string `json:"error"`
	Code      string `json:"code,omitempty"`
	Message   string `json:"message,omitempty"`
	Timestamp string `json:"ts"`
	TraceId   string `json:"tid"`
}

func BadRequest

func BadRequest(message string) *Error

func Conflict

func Conflict(message string) *Error

func Forbidden

func Forbidden(message string) *Error

func InternalError

func InternalError(message string) *Error

func New

func New(status int, message string) *Error

func NotAllowed

func NotAllowed(message string) *Error

func NotFound

func NotFound(message string) *Error

func OK

func OK(message string) *Error

func Unauthorized

func Unauthorized(message string) *Error

func (*Error) String

func (e *Error) String() string

func (*Error) WithCode

func (e *Error) WithCode(code string) *Error

func (*Error) WithContext

func (e *Error) WithContext(ctx context.Context) *Error

Jump to

Keyboard shortcuts

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