Documentation ¶
Index ¶
- func NewCache() cache.Cache
- func NewLogger() logger.Logger
- type Cache
- func (m *Cache) Contains(key string) (bool, error)
- func (m *Cache) Delete(key string) error
- func (m *Cache) ExpireAfter(key string, duration time.Duration) error
- func (m *Cache) Get(key string, out interface{}) error
- func (m *Cache) GetOrDefault(key string, out interface{}, def interface{}) error
- func (m *Cache) Set(key string, val interface{}) error
- type Logger
- func (z *Logger) Debug(msg interface{})
- func (z *Logger) Debugf(msg string, values ...interface{})
- func (z *Logger) Error(msg interface{})
- func (z *Logger) Errorf(msg string, values ...interface{})
- func (z *Logger) Fatal(msg interface{})
- func (z *Logger) Fatalf(msg string, values ...interface{})
- func (z *Logger) Field(name string, val interface{}) logger.Logger
- func (z *Logger) Fields(fields logger.Fields) logger.Logger
- func (z *Logger) Info(msg interface{})
- func (z *Logger) Infof(msg string, values ...interface{})
- func (z *Logger) Trace(msg interface{})
- func (z *Logger) Tracef(msg string, values ...interface{})
- func (z *Logger) Warn(msg interface{})
- func (z *Logger) Warnf(msg string, values ...interface{})
- type Renderer
- type Router
- func (r *Router) CONNECT(path string, handler interface{}) error
- func (r *Router) DELETE(path string, handler interface{}) error
- func (r *Router) GET(path string, handler interface{}) error
- func (r *Router) HEAD(path string, handler interface{}) error
- func (r *Router) ListenAndServe(address string) error
- func (r *Router) OPTIONS(path string, handler interface{}) error
- func (r *Router) PATCH(path string, handler interface{}) error
- func (r *Router) POST(path string, handler interface{}) error
- func (r *Router) PUT(path string, handler interface{}) error
- func (r *Router) Shutdown() error
- func (r *Router) TRACE(path string, handler interface{}) error
- func (r *Router) WithErrorHandler(handler interface{}) error
- func (r *Router) WithGroup(path string, callback func(group router.Group)) error
- func (r *Router) WithMethodNotAllowedHandler(handler interface{}) error
- func (r *Router) WithMiddleware(handler interface{}) error
- func (r *Router) WithNotFoundHandler(handler interface{}) error
- func (r *Router) WithRoute(method string, path string, handler interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶ added in v0.0.3
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) Delete ¶ added in v0.0.3
Delete removes a cache entry by its key, will do nothing if the key was not present in the cache It will also cancel any existing expirations for the given key
func (*Cache) ExpireAfter ¶ added in v0.0.3
ExpireAfter will mark a cache key for expiration after a certain duration
func (*Cache) Get ¶ added in v0.0.3
Get will attempt to read a stored cache value into the given out interface pointer or error if not present
func (*Cache) GetOrDefault ¶ added in v0.0.3
Get will attempt to read a stored cache value into the given out interface pointer or return default if not found
type Logger ¶ added in v0.0.3
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) Debug ¶ added in v0.0.3
func (z *Logger) Debug(msg interface{})
Debug will write a debug log
func (*Logger) Error ¶ added in v0.0.3
func (z *Logger) Error(msg interface{})
Error will write a error log
func (*Logger) Fatal ¶ added in v0.0.3
func (z *Logger) Fatal(msg interface{})
Fatal will write a fatal log
func (*Logger) Fields ¶ added in v0.0.3
Fields will add multiple fields to a new logger and return it
func (*Logger) Info ¶ added in v0.0.3
func (z *Logger) Info(msg interface{})
Info will write a info log
func (*Logger) Trace ¶ added in v0.0.3
func (z *Logger) Trace(msg interface{})
Trace will write a trace log
type Renderer ¶ added in v0.0.3
type Renderer struct {
// contains filtered or unexported fields
}
func NewRenderer ¶
func NewRenderer() *Renderer
func (Renderer) Render ¶ added in v0.0.3
Render will load a template file and render the template within using the viewbag as a context
func (Renderer) SetTemplateDir ¶ added in v0.0.3
SetTemplateDir will set the base directory where views are located
func (Renderer) TemplateDir ¶ added in v0.0.3
TemplateDir will return the absolute path of the configured templates directory
type Router ¶ added in v0.0.3
type Router struct { Middleware []interface{} Routes []router.Handler Router *httprouter.Router Server *http.Server }
func NewRouter ¶ added in v0.0.3
func NewRouter() *Router
NewRouter will create new instance of the mojito stdlib router implementation
func (*Router) CONNECT ¶ added in v0.0.3
CONNECT will add a route to this router for the connect method
func (*Router) DELETE ¶ added in v0.0.3
DELETE will add a route to this router for the delete method
func (*Router) ListenAndServe ¶ added in v0.0.3
ListenAndServe will start an HTTP webserver on the given address
func (*Router) OPTIONS ¶ added in v0.0.3
OPTIONS will add a route to this router for the options method
func (*Router) WithErrorHandler ¶ added in v0.0.3
WithErrorHandler will set the error handler for the router
func (*Router) WithGroup ¶ added in v0.0.3
WithGroup will create a new route group for the given prefix
func (*Router) WithMethodNotAllowedHandler ¶ added in v0.0.4
WithMethodNotAllowedHandler will set the not allowed handler for the router
func (*Router) WithMiddleware ¶ added in v0.0.3
WithMiddleware will add a middleware to the router
func (*Router) WithNotFoundHandler ¶ added in v0.0.4
WithNotFoundHandler will set the not found handler for the router