mirror of
https://github.com/nkanaev/yarr.git
synced 2025-12-15 16:40:04 +00:00
login page tweaks
This commit is contained in:
@@ -3,6 +3,7 @@ package router
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@@ -34,6 +35,12 @@ func (c *Context) JSON(status int, data interface{}) {
|
||||
c.Out.Write([]byte("\n"))
|
||||
}
|
||||
|
||||
func (c *Context) HTML(status int, tmpl *template.Template, data interface{}) {
|
||||
c.Out.WriteHeader(status)
|
||||
c.Out.Header().Set("Content-Type", "text/html")
|
||||
tmpl.Execute(c.Out, data)
|
||||
}
|
||||
|
||||
func (c *Context) VarInt64(key string) (int64, error) {
|
||||
if val, ok := c.Vars[key]; ok {
|
||||
return strconv.ParseInt(val, 10, 64)
|
||||
|
||||
Reference in New Issue
Block a user