Documentation ¶
Overview ¶
Serve webpages with onthefly and http
Index ¶
- func BackButton() string
- func CleanUserInput(val string) string
- func GetFormParam(req *http.Request, key string) string
- func GetLast(url *url.URL) string
- func GetParam(req *http.Request, key string) string
- func GetVal(url *url.URL, pos int) string
- func HTMLPageRedirect(url string) string
- func HostPortSplit(s string) (string, string)
- func LoginForm() string
- func Message(title, msg string) string
- func MessageOKback(title, msg string) string
- func MessageOKurl(title, msg, url string) string
- func Publish(r *mux.Router, url, filename string)
- func PublishFile(r *mux.Router, url, filename string)
- func PublishPage(r *mux.Router, htmlurl, cssurl string, buildfunction func(string) *Page)
- func PublishRootFile(r *mux.Router, filename string)
- func RegisterForm() string
- func Ret(w http.ResponseWriter, s string)
- func TableCell(b bool) string
- func TruthValue(val string) bool
- type HTTPHandler
- type SimpleContextHandle
- type TemplateValueGenerator
- type WebHandle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanUserInput ¶
func GetFormParam ¶
Returns a form parameter, or an empty string
func HTMLPageRedirect ¶
HTML page that redirects to an url by using JavaScript
func HostPortSplit ¶
Split a string into two strings at the colon If there's no colon, return the string and an empty string
func LoginForm ¶
func LoginForm() string
Generic login form, not a complete html page. Sends a POST request to /login. Passes "password". (Only "name=" fields). Remember to don't send passwords in plaintext. Use https.
func MessageOKback ¶
Message page where the ok button goes one back in history by using JavaScript
func MessageOKurl ¶
Message page where the ok button goes to a given url using JavaScript
func PublishFile ¶
Takes an url and a filename and offers that file at the given url
func PublishPage ¶
Expose the HTML and CSS generated by a page building function to the two given urls
func PublishRootFile ¶
Takes a filename and offers that file at the root url
func RegisterForm ¶
func RegisterForm() string
Generic registration form, not a complete html page. Sends a POST request to /register. Passes "password1", "password2" and "email". (Only "name=" fields). Remember to don't send passwords in plaintext. Use https.
func Ret ¶
func Ret(w http.ResponseWriter, s string)
Write the given string to the response writer. Convenience function.
Types ¶
type HTTPHandler ¶
type HTTPHandler func(http.ResponseWriter, *http.Request)
func File ¶
func File(filename string) HTTPHandler
Takes a filename and returns a function that can handle the request
func GenerateCSS ¶
func GenerateCSS(page *Page) HTTPHandler
Create a web.go compatible function that returns a string that is the CSS for this page
func GenerateErrorHandle ¶
func GenerateErrorHandle(errorfilename string) HTTPHandler
Creates a page based on the contents of "error.log". Useful for showing compile errors while creating an application.
func GenerateHTML ¶
func GenerateHTML(page *Page) HTTPHandler
Create a web.go compatible function that returns a string that is the HTML for this page
func GenerateXML ¶
func GenerateXML(page *Page) HTTPHandler
Create a web.go compatible function that returns a string that is the XML for this page
type SimpleContextHandle ¶
type SimpleContextHandle func(w http.ResponseWriter, r *http.Request)
type TemplateValueGenerator ¶
type TemplateValueGenerator func(w http.ResponseWriter, r *http.Request) TemplateValues