Documentation ¶
Index ¶
Constants ¶
View Source
const (
ErrCodeUndefined = -1
)
Variables ¶
View Source
var ( ErrUndefined = ErrorRegistry(). AddErrorCode(ErrCodeUndefined). HttpStatus(http.StatusInternalServerError). NewError("undefined error") ErrInvalidParam = ErrorRegistry(). AddErrorCode(4000). HttpStatus(http.StatusBadRequest). NewError("invalid parameter") ErrExists = ErrorRegistry(). AddErrorCode(4001). HttpStatus(http.StatusConflict). NewError("resource already existed") ErrNotExists = ErrorRegistry(). AddErrorCode(4002). HttpStatus(http.StatusNotFound). NewError("resource does not exist") ErrSystem = ErrorRegistry(). AddErrorCode(5000). HttpStatus(http.StatusInternalServerError). NewError("system issue") ErrDatabase = ErrorRegistry(). AddErrorCode(5001). HttpStatus(http.StatusInternalServerError). NewError("database issue") )
View Source
var ( ErrInvalidUsername = ErrorRegistry(). AddErrorCode(6000). WrapError("username must be having a upper letter", ErrInvalidParam) )
Functions ¶
func ErrorRegistry ¶
func ErrorRegistry() *utility.ErrorRegistry
func UnwrapError ¶
func UnwrapError(err error) *utility.CustomError
Types ¶
type Config ¶
type Config struct { AppId_ string `yaml:"AppId"` Hack utility.Hack `yaml:"Hack"` ShowErrCode bool `yaml:"ShowErrCode"` Filename Filename `yaml:"Filename"` Http Http `yaml:"Http"` MySql MySql `yaml:"MySql"` Redis Redis `yaml:"Redis"` O11Y utility.O11YConfig `yaml:"O11Y"` Logger wlog.Config `yaml:"Logger"` }
func MustLoadConfig ¶
func MustLoadConfig() *Config
Directories ¶
Path | Synopsis |
---|---|
Package app is a generated GoMock package.
|
Package app is a generated GoMock package. |
dataflow
ref1: https://github.com/KScaesar/art?tab=readme-ov-file#example
|
ref1: https://github.com/KScaesar/art?tab=readme-ov-file#example |
wfiber
wfiber is a wrapped fiber
|
wfiber is a wrapped fiber |
wgin
wgin is a wrapped gin
|
wgin is a wrapped gin |
wlog
wlog is a wrapped logger
|
wlog is a wrapped logger |
Click to show internal directories.
Click to hide internal directories.