mirror of
https://github.com/Sean-Der/fail2rest.git
synced 2024-12-22 21:52:18 +01:00
Rename global->basic for route, this more closely models the fail2ban-client documentation
This commit is contained in:
parent
3c3efd4449
commit
de2a4e62f0
2 changed files with 6 additions and 6 deletions
|
@ -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")
|
||||
}
|
2
main.go
2
main.go
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue