Versions in this module Expand all Collapse all v0 v0.0.1 Mar 23, 2023 Changes in this version + const AbortIndex + const DebugMode + const EnvNinMode + const ReleaseMode + const TestMode + var DebugPrintRouteFunc func(path, handlerName string, nuHandlers int) + var DefaultErrorWriter io.Writer = os.Stderr + var DefaultWriter io.Writer = os.Stdout + var ErrPathInvalid = errors.New("no valid path") + var ErrPathNotFound = func(path string) error + var ErrPrivateKeyEmpty = errors.New("privateKey can not be empty") + var StatusMap = map[sdk.Status]string + func IsDebugging() bool + func Mode() string + func SetMode(value string) + type Action struct + func (ac *Action) SetA(a string) + func (ac *Action) SetC(c string) + func (ac *Action) SetE(e string) + func (ac *Action) SetM(m string) + func (ac *Action) SetP(p string) + type Context struct + Action *Action + Errors errorMsgs + Event *sdk.Event + Handlers HandlersChain + Keys map[string]any + Path string + PublicKey string + Status sdk.Status + Writer *sdk.Relay + func (c *Context) Abort() + func (c *Context) AbortWithError(err error) error + func (c *Context) Error(err error) *Error + func (c *Context) Get(key string) (value any, exists bool) + func (c *Context) GetBool(key string) (b bool) + func (c *Context) GetDuration(key string) (d time.Duration) + func (c *Context) GetFloat64(key string) (f64 float64) + func (c *Context) GetInt(key string) (i int) + func (c *Context) GetInt64(key string) (i64 int64) + func (c *Context) GetString(key string) (s string) + func (c *Context) GetStringMap(key string) (sm map[string]any) + func (c *Context) GetStringMapString(key string) (sms map[string]string) + func (c *Context) GetStringMapStringSlice(key string) (smss map[string][]string) + func (c *Context) GetStringSlice(key string) (ss []string) + func (c *Context) GetTime(key string) (t time.Time) + func (c *Context) GetUint(key string) (ui uint) + func (c *Context) GetUint64(key string) (ui64 uint64) + func (c *Context) IsAborted() bool + func (c *Context) MustGet(key string) any + func (c *Context) Next() error + func (c *Context) Set(key string, value any) + func (c *Context) String(value string) error + type Engine struct + func Default(opt *Options) (*Engine, error) + func New(opt *Options) (*Engine, error) + func (e *Engine) Run() + type Error struct + Err error + Meta any + Type ErrorType + func (msg *Error) IsType(flags ErrorType) bool + func (msg *Error) JSON() any + func (msg *Error) MarshalJSON() ([]byte, error) + func (msg *Error) SetMeta(data any) *Error + func (msg *Error) SetType(flags ErrorType) *Error + func (msg *Error) Unwrap() error + func (msg Error) Error() string + type ErrorType uint64 + const ErrorTypeAny + const ErrorTypeBind + const ErrorTypeNu + const ErrorTypePrivate + const ErrorTypePublic + const ErrorTypeRender + type HandlerFunc func(*Context) error + func CustomRecovery(handle RecoveryFunc) HandlerFunc + func CustomRecoveryWithWriter(out io.Writer, handle RecoveryFunc) HandlerFunc + func Logger() HandlerFunc + func LoggerWithConfig(conf LoggerConfig) HandlerFunc + func Recovery() HandlerFunc + func RecoveryWithWriter(out io.Writer, recovery ...RecoveryFunc) HandlerFunc + type HandlersChain []HandlerFunc + func (c HandlersChain) Last() HandlerFunc + type IRoutes interface + Add func(path string, handlers ...HandlerFunc) IRoutes + Close func() error + Handlers func() map[string]HandlersChain + Middles func() HandlersChain + Use func(handlers ...HandlerFunc) IRoutes + type LogFormatter func(params LogFormatterParams) string + type LogFormatterParams struct + BodySize int + ErrorMessage string + ID string + Keys map[string]any + Latency time.Duration + Path string + PubKey string + PublishStatus sdk.Status + TimeStamp time.Time + func (p *LogFormatterParams) IsOutputColor() bool + func (p *LogFormatterParams) PublishStatusColor() string + func (p *LogFormatterParams) ResetColor() string + type LoggerConfig struct + Formatter LogFormatter + Output io.Writer + SkipPaths []string + type Options struct + Addr string + ErrFun func(err error) + Filters sdk.Filters + PrivateKey string + Scheme string + SubPubKey []string + func (opt *Options) PublicKey() string + func (opt *Options) URL() string + type RecoveryFunc func(c *Context, err any) + type Router struct + MiddleWares HandlersChain + func (r *Router) Add(path string, handlers ...HandlerFunc) IRoutes + func (r *Router) Close() error + func (r *Router) Handlers() map[string]HandlersChain + func (r *Router) Middles() HandlersChain + func (r *Router) Use(middleware ...HandlerFunc) IRoutes