Documentation
¶
Index ¶
- type Context
- func (c *Context) AddAllowedURL(path string)
- func (c *Context) AddMiddleware(mid Middleware)
- func (c *Context) AddRoute(name, method, prefix string, handler Handler)
- func (c *Context) Close()
- func (c *Context) ExtendAndRender(w http.ResponseWriter, base, template string, data *map[string]interface{}) error
- func (c *Context) IsURLAllowed(path string) bool
- func (c *Context) ListenAndServe() error
- func (c *Context) Render(w http.ResponseWriter, template string, data *map[string]interface{}) error
- func (c *Context) Reverse(name string, args ...interface{}) string
- func (c *Context) SetNotFoundTemplate(template string)
- func (c *Context) SetPanicTemplate(template string)
- func (c *Context) Static(path string) string
- type Handler
- type Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
Config *config.Configuration
Database *db.Database
TemplateManager *template.Manager
URLManager *urls.Manager
Router *httprouter.Router
Store *sessions.CookieStore
Middleware []Middleware
AllowedURL map[string]bool
}
func CreateContextFromConf ¶
func CreateContextFromPath ¶
func (*Context) AddAllowedURL ¶
func (*Context) AddMiddleware ¶
func (c *Context) AddMiddleware(mid Middleware)
func (*Context) ExtendAndRender ¶
func (*Context) IsURLAllowed ¶
func (*Context) ListenAndServe ¶
func (*Context) SetNotFoundTemplate ¶
func (*Context) SetPanicTemplate ¶
Click to show internal directories.
Click to hide internal directories.