Documentation ¶
Overview ¶
Package flexwork contains utility functionality for writing HTTP handlers and building HTTP servers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(w http.ResponseWriter, code int, fmtStr string, vars ...interface{})
Error is a convenience function for http.Error, but it allows you to specify the error string in a format string
func MatchHost ¶
MatchHost creates a handler that invokes the appropriate handler for the incoming request's Host header, according to handlers. It looks for exact host values (no regexes) in handlers
func MatchesMethod ¶
MatchesMethod returns whether or not the method in r is the same as m
Types ¶
type Method ¶
type Method string
Method is the type for the incoming HTTP Method
const ( // Get is the constant for the HTTP GET method Get Method = "GET" // Post is the constant for the HTTP POST method Post Method = "POST" // Put is the constant for the HTTP PUT method Put Method = "PUT" // Delete is the constant for the HTTP DELETE method Delete Method = "DELETE" // Head is the constant for the HTTP HEAD method Head Method = "HEAD" // Options is the constant for the HTTP OPTIONS method Options Method = "OPTIONS" )
Click to show internal directories.
Click to hide internal directories.