errorsHandler

package
v0.0.0-...-22ff681 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FA = "fa"
	EN = "en"
)
View Source
const (
	DefaultError = "default_error"
)

Variables

View Source
var DefaultENErrorsMap = LangErrorMap{
	DefaultError: "internal error",
}
View Source
var DefaultErrorsMap = MapErrors{
	FA: DefaultFAErrorsMap,
	EN: DefaultENErrorsMap,
}
View Source
var DefaultFAErrorsMap = LangErrorMap{
	DefaultError: "مشکل در ارتباط داخلی",
}

Functions

func GinErrorResponseHandler

func GinErrorResponseHandler(c *gin.Context, err error)

func Init

func Init(errors ErrorsModel)

Types

type CodeErrorMap

type CodeErrorMap map[string]int

type ErrorsModel

type ErrorsModel struct {
	ErrorsMap     MapErrors
	CodeErrorsMap CodeErrorMap
}
var Model ErrorsModel

type LangErrorMap

type LangErrorMap map[string]string

type MapErrors

type MapErrors map[string]LangErrorMap

Jump to

Keyboard shortcuts

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