Rename global->basic for route, this more closely models the fail2ban-client documentation

This commit is contained in:
Sean DuBois 2014-06-15 01:28:57 +00:00
parent 3c3efd4449
commit de2a4e62f0
2 changed files with 6 additions and 6 deletions

View file

@ -7,7 +7,7 @@ import (
"strings"
)
func GlobalStatusHandler(res http.ResponseWriter, req *http.Request) {
func BasicStatusHandler(res http.ResponseWriter, req *http.Request) {
fail2banInput := make([]string, 1)
fail2banInput[0] = "status"
@ -26,7 +26,7 @@ func GlobalStatusHandler(res http.ResponseWriter, req *http.Request) {
res.Write(encodedOutput)
}
func GlobalPingHandler(res http.ResponseWriter, req *http.Request) {
func BasicPingHandler(res http.ResponseWriter, req *http.Request) {
fail2banInput := make([]string, 1)
fail2banInput[0] = "ping"
@ -44,7 +44,7 @@ func GlobalPingHandler(res http.ResponseWriter, req *http.Request) {
res.Write(encodedOutput)
}
func GlobalHandler(globalRouter *mux.Router) {
globalRouter.HandleFunc("/status", GlobalStatusHandler).Methods("GET")
globalRouter.HandleFunc("/ping", GlobalPingHandler).Methods("GET")
func BasicHandler(basicRouter *mux.Router) {
basicRouter.HandleFunc("/status", BasicStatusHandler).Methods("GET")
basicRouter.HandleFunc("/ping", BasicPingHandler).Methods("GET")
}

View file

@ -29,7 +29,7 @@ func main() {
}
r := mux.NewRouter()
GlobalHandler(r.PathPrefix("/global").Subrouter())
BasicHandler(r.PathPrefix("/basic").Subrouter())
http.Handle("/", r)
http.ListenAndServe(configuration.Addr, nil)
}