core

package
v0.0.0-...-a9fe51a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

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 CreateContextFromConf(fsys fs.FS, static config.Static, conf *config.Configuration) (*Context, error)

func CreateContextFromPath

func CreateContextFromPath(fsys fs.FS, static config.Static, configFile string) (*Context, error)

func (*Context) AddAllowedURL

func (c *Context) AddAllowedURL(path string)

func (*Context) AddMiddleware

func (c *Context) AddMiddleware(mid Middleware)

func (*Context) AddRoute

func (c *Context) AddRoute(name, method, prefix string, handler Handler)

func (*Context) Close

func (c *Context) Close()

func (*Context) ExtendAndRender

func (c *Context) ExtendAndRender(w http.ResponseWriter, base, template string,
	data *map[string]interface{}) error

func (*Context) IsURLAllowed

func (c *Context) IsURLAllowed(path string) bool

func (*Context) ListenAndServe

func (c *Context) ListenAndServe() error

func (*Context) Render

func (c *Context) Render(w http.ResponseWriter, template string,
	data *map[string]interface{}) error

func (*Context) Reverse

func (c *Context) Reverse(name string, args ...interface{}) string

func (*Context) SetNotFoundTemplate

func (c *Context) SetNotFoundTemplate(template string)

func (*Context) SetPanicTemplate

func (c *Context) SetPanicTemplate(template string)

func (*Context) Static

func (c *Context) Static(path string) string

type Handler

type Handler func(http.ResponseWriter, *http.Request, *Context)

type Middleware

type Middleware func(http.Handler) http.Handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL