Versions in this module Expand all Collapse all v0 v0.1.2 Jun 26, 2023 Changes in this version + var GetCurrentUser func(c echo.Context) (CurrentUser, error) = nil + type CurrentUser struct + ID uint64 + Name string + Nickname string v0.1.1 Jun 25, 2023 Changes in this version + func GetRequestID(c echo.Context) (id string) v0.1.0 Jun 21, 2023 Changes in this version + var AppName = "echop" + var DefaultResponseFailCode = 1 + var DefaultResponseFailMsg = "fail" + var DefaultResponseSuccessCode = 0 + var DefaultResponseSuccessMsg = "ok" + var Logger *zap.Logger + var RequestIDConfig = middleware.DefaultRequestIDConfig + var RequestLoggerConfig = middleware.RequestLoggerConfig + var RouteNotFound = "echo_route_not_found" + func GetAppRunPath() (runPath string) + func GetRequestId(c echo.Context) (id string) + func InitLogger(l *zap.Logger) + func LogDebug(msg string, fields ...zap.Field) + func LogDebugWithContext(c echo.Context, msg string, fields ...zap.Field) + func LogError(msg string, fields ...zap.Field) + func LogErrorWithContext(c echo.Context, msg string, fields ...zap.Field) + func LogInfo(msg string, fields ...zap.Field) + func LogInfoWithContext(c echo.Context, msg string, fields ...zap.Field) + func LogWarn(msg string, fields ...zap.Field) + func LogWarnWithContext(c echo.Context, msg string, fields ...zap.Field) + func OverrideContext() echo.MiddlewareFunc + func WrapHandlerFunc(h HandlerFunc) echo.HandlerFunc + type Context interface + BindAndValidate func(payload any) error + Json func(httpCode int, resp JSONResponse) error + JsonFail func(i any, msg string) error + JsonFailWithCode func(code any, data any, msg string) error + JsonSuccess func(i any, msg string) error + JsonSuccessWithCode func(code any, data any, msg string) error + LogError func(msg string, fields ...zap.Field) + LogInfo func(msg string, fields ...zap.Field) + LogWarn func(msg string, fields ...zap.Field) + type Echop struct + func New() (ep *Echop) + func (ep *Echop) Add(method, path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) Any(path string, h HandlerFunc, m ...echo.MiddlewareFunc) []*echo.Route + func (ep *Echop) CONNECT(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) DELETE(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) DefaultHTTPErrorHandler(err error, c echo.Context) + func (ep *Echop) GET(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) Group(prefix string, m ...echo.MiddlewareFunc) *Group + func (ep *Echop) HEAD(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) Match(methods []string, path string, h HandlerFunc, m ...echo.MiddlewareFunc) []*echo.Route + func (ep *Echop) OPTIONS(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) PATCH(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) POST(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) PUT(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) RouteNotFound(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) TRACE(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (ep *Echop) URI(handler HandlerFunc, params ...interface{}) string + func (ep *Echop) URL(handler HandlerFunc, params ...interface{}) string + type Group struct + G *echo.Group + func (g *Group) Add(method, path string, handler HandlerFunc, middleware ...echo.MiddlewareFunc) *echo.Route + func (g *Group) Any(path string, handler HandlerFunc, middleware ...echo.MiddlewareFunc) []*echo.Route + func (g *Group) CONNECT(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) DELETE(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) File(path, file string) + func (g *Group) FileFS(path, file string, filesystem fs.FS, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) GET(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) Group(prefix string, m ...echo.MiddlewareFunc) *Group + func (g *Group) HEAD(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) Match(methods []string, path string, handler HandlerFunc, ...) []*echo.Route + func (g *Group) OPTIONS(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) PATCH(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) POST(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) PUT(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) RouteNotFound(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) Static(pathPrefix, fsRoot string) + func (g *Group) StaticFS(pathPrefix string, filesystem fs.FS) + func (g *Group) TRACE(path string, h HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + func (g *Group) Use(middleware ...echo.MiddlewareFunc) + type HandlerFunc func(c Context) error + type JSONResponse struct + Code any + Data any + Message string + type LoggerFields struct + C echo.Context + Fields []zap.Field + Msg string + type Validator struct + func NewValidator() *Validator + func (v *Validator) Validate(i any) error