miniweb

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: MIT Imports: 4 Imported by: 0

README

Miniweb

Miniweb is a simple and small library to develop small website applications.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TemplatePath    = "./templates"
	AdditionalFuncs template.FuncMap
	Dev             = false
)

Functions

func Register

func Register(handler Handler)

func Run

func Run(addr string) error

func StaticContent added in v0.0.2

func StaticContent(url, dirname string)

Types

type Context

type Context struct {
	Writer      http.ResponseWriter
	Request     *http.Request
	Template    *template.Template
	ContextData map[string]interface{}
}

func (*Context) SendString added in v0.0.3

func (c *Context) SendString(data string)

func (*Context) SendTemplate

func (c *Context) SendTemplate(data interface{})

type Handler

type Handler struct {
	Url          string
	Func         HandlerFunc
	TemplateFile string
	LayoutFile   string
}

type HandlerFunc

type HandlerFunc func(c *Context)

type HandlerFuncSet added in v0.0.4

type HandlerFuncSet []HandlerFunc
var (
	PreHandlerFuncs  HandlerFuncSet
	PostHandlerFuncs HandlerFuncSet
)

func (*HandlerFuncSet) Add added in v0.0.4

func (h *HandlerFuncSet) Add(handler HandlerFunc)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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