statuscode

package
v0.0.0-...-e662f33 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK int64 = 0
	// 10000 - 19999: User & Auth Related
	Unauthorized           int64 = 10001
	Forbidden              int64 = 10002
	TokenGeneral           int64 = 10010
	TokenMissing           int64 = 10011
	TokenMalformed         int64 = 10012
	TokenExpired           int64 = 10013
	TokenInvalid           int64 = 10014
	EmailOrPasswordInvalid int64 = 10021
	EmailAlreadyRegistered int64 = 10022
	TooManyRequests        int64 = 19001
	// 30000 - 39999: Resource Related
	ResourceGeneral   int64 = 30000
	ResourceForbidden int64 = 30003
	ResourceNotFound  int64 = 30004
	// --> 31000 - 31999: Product related
	ProductNotFound           int64 = 31004
	ProductTitleTooShort      int64 = 31111
	ProductTitleTooLong       int64 = 31112
	ProductDescriptionTooLong int64 = 31121
	ProductCategoryEmpty      int64 = 31131
	ProductCategoryInvalid    int64 = 31132
	ProductPriceInvalid       int64 = 31141
	ProductPriceTooLow        int64 = 31142
	ProductTagsTooLong        int64 = 31151
	// 40000 - 49999: Request Validations
	BadRequest        int64 = 40000
	PasswordMalformed int64 = 40001
	UnparsableBody    int64 = 42000
	// 90000 - 99999: Server & Unknown Errors
	ServerError        int64 = 90000
	ServiceUnavailable int64 = 90003
	UnknownError       int64 = 99999
)

Variables

Functions

func HTTP

func HTTP(code int64) int

func Message

func Message(code int64) string

func ParseGrpcErrMsg

func ParseGrpcErrMsg(msg string) (int64, string)

func StandardErrorMessage

func StandardErrorMessage(code int64, message string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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