Documentation ¶
Index ¶
- Variables
- func FromKey(s string) string
- func ToKey(s string) string
- type App
- func (wfa *App) AddRoute(path string, ...)
- func (wfa *App) GetRow(table, key string) map[string]interface{}
- func (wfa *App) GetRows(table string) []map[string]interface{}
- func (wfa *App) InsertRow(table, key, value string) error
- func (wfa *App) ReadCookie(r *http.Request) map[string]string
- func (wfa *App) Render(c *wsrooms.Conn, msg *wsrooms.Message, template string, controllers []string, ...)
- func (wfa *App) SetCookie(w http.ResponseWriter, r *http.Request, value map[string]string, logout bool)
- func (wfa *App) Start()
- type Auth
Constants ¶
This section is empty.
Variables ¶
View Source
var TemplateFuncs = template.FuncMap{ "unescaped": func(x string) interface{} { return template.HTML(x) }, "sha1sum": func(x string) string { return fmt.Sprintf("%x", sha1.Sum([]byte(x))) }, "subtract": func(a, b int) int { return a - b }, "add": func(a, b int) int { return a + b }, "multiply": func(a, b int) int { return a * b }, "divide": func(a, b int) int { return a / b }, "usd": func(x int) string { return fmt.Sprintf("$%.2f", float64(x)/float64(100)) }, "css": func(s string) template.CSS { return template.CSS(s) }, "tokey": ToKey, "fromkey": FromKey, }
Functions ¶
Types ¶
type App ¶
type App struct { Name string `json:"name"` HashKey string `json:"hashkey"` BlockKey string `json:"blockkey"` SecureCookie *securecookie.SecureCookie Templates *template.Template Port string `json:"port"` SSLPort string `json:"sslport"` Database struct { User string `json:"user"` Password string `json:"password"` Name string `json:"name"` } `json:"database"` Driver *sql.DB Routes []struct { Route string `json:"route"` Admin struct { Table string `json:"table"` Key string `json:"key"` Template string `json:"template"` Controllers string `json:"controllers"` } `json:"admin"` Authorized struct { Privilege string `json:"privilege"` Table string `json:"table"` Key string `json:"key"` Template string `json:"template"` Controllers string `json:"controllers"` } `json:"authorized"` Table string `json:"table"` Key string `json:"key"` Template string `json:"template"` Controllers string `json:"controllers"` } `json:"routes"` Added []struct { Route string Handler func(c *wsrooms.Conn, msg *wsrooms.Message, matches []string) } Router *mux.Router }
Click to show internal directories.
Click to hide internal directories.