Documentation
¶
Index ¶
- func AddSlashForRoot(next http.Handler) http.Handler
- func AllowedHeaders() handlers.CORSOption
- func AllowedMethods() handlers.CORSOption
- func AllowedOrigins() handlers.CORSOption
- func CORS(h http.Handler) http.Handler
- func GetInt(v url.Values, key string, defaultValue int) int
- func JsonEncode(w http.ResponseWriter, v interface{}) error
- func JsonError(w http.ResponseWriter, responseCode int, msg string)
- func JsonSuccess(w http.ResponseWriter)
- func Mount(r *mux.Router, path string, handler http.Handler)
- func NotAllowedHandler(w http.ResponseWriter, _ *http.Request)
- func NotFoundHandler(w http.ResponseWriter, _ *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSlashForRoot ¶
AddSlashForRoot adds a slash if the path is the root path. This is necessary for our subrouters where there may be a root.
func AllowedHeaders ¶
func AllowedHeaders() handlers.CORSOption
AllowedHeaders returns a standard AllowedHeaders handlers.CORSOption.
func AllowedMethods ¶
func AllowedMethods() handlers.CORSOption
AllowedMethods returns a handlers.CORSOption allowing all standard rest methods.
func AllowedOrigins ¶
func AllowedOrigins() handlers.CORSOption
AllowedOrigins returns a handlers.CORSOption allowing all origins.
func JsonEncode ¶
func JsonEncode(w http.ResponseWriter, v interface{}) error
JsonEncode marshals an interface and writes it to the response.
func JsonError ¶
func JsonError(w http.ResponseWriter, responseCode int, msg string)
JsonError writes an Error to the ResponseWriter with the provided information.
func JsonSuccess ¶
func JsonSuccess(w http.ResponseWriter)
JsonSuccess writes a success message to the writer.
func NotAllowedHandler ¶
func NotAllowedHandler(w http.ResponseWriter, _ *http.Request)
NotAllowedHandler handles 405 responses
func NotFoundHandler ¶
func NotFoundHandler(w http.ResponseWriter, _ *http.Request)
NotFoundHandler handles 404 responses
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.