status

package module
v0.0.0-...-c1cb7b8 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// Code stores the error code.
	Code StatusCode

	// Message stores the error message.
	Message string
}

Error stores the error message and code.

func (*Error) Error

func (e *Error) Error() string

Error returns error message in string type.

type StatusCode

type StatusCode int

StatusCode is used as a key for error codes.

const (
	// CodeInternal indicates an internal server error.
	CodeInternal StatusCode = iota

	// CodeNotFound indicates a not found error.
	CodeNotFound

	// CodeAlreadyExists indicates errors that already exist.
	CodeAlreadyExists

	// CodeInvalidArgument indicates an invalid argument error.
	CodeInvalidArgument
)

Jump to

Keyboard shortcuts

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