Documentation ¶
Index ¶
- Constants
- Variables
- func AddCache(cache Cache)
- func AddSession(session Session)
- func AddView(view View)
- func DropCache(cache Cache)
- func DropSession(session Session)
- func DropView(view View)
- func PrintVersionInfo(w io.Writer, verbose bool, mode PrintMode)
- func Render(tmpl *template.Template, fun func(*http.Request) interface{}) func(http.ResponseWriter, *http.Request)
- func Serve(ctx context.Context, addr string) error
- type Cache
- type File
- type PrintMode
- type Session
- type View
Constants ¶
View Source
const ( PlainText = PrintMode(iota) Markdown HTML )
Variables ¶
View Source
var BaseTemplate = template.Must(template.New("").Parse(` <html> <head> <title>{{template "title" .}}</title> <style> .profile-name{ display:inline-block; width:6rem; } td.value { text-align: right; } </style> {{block "head" .}}{{end}} </head> <body> <a href="/">Main</a> <a href="/info">Info</a> <a href="/memory">Memory</a> <a href="/debug/">Debug</a> <hr> <h1>{{template "title" .}}</h1> {{block "body" .}} Unknown page {{end}} </body> </html> {{define "cachelink"}}<a href="/cache/{{.}}">Cache {{.}}</a>{{end}} {{define "sessionlink"}}<a href="/session/{{.}}">Session {{.}}</a>{{end}} {{define "viewlink"}}<a href="/view/{{.}}">View {{.}}</a>{{end}} {{define "filelink"}}<a href="/file/{{.Session.ID}}/{{.Hash}}">{{.URI}}</a>{{end}} `)).Funcs(template.FuncMap{ "fuint64": fuint64, "fuint32": fuint32, })
Functions ¶
func AddSession ¶
func AddSession(session Session)
AddSession adds a session to the set being served
func DropSession ¶
func DropSession(session Session)
DropSession drops a session from the set being served
func PrintVersionInfo ¶
This writes the version and environment information to a writer.
Types ¶
Click to show internal directories.
Click to hide internal directories.