diff options
Diffstat (limited to 'handlers.go')
-rw-r--r-- | handlers.go | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/handlers.go b/handlers.go index d57feee..4b2ceef 100644 --- a/handlers.go +++ b/handlers.go @@ -8,19 +8,7 @@ import ( "time" ) -func validRequest(fn func(http.ResponseWriter, *http.Request, string)) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - m := confObj.validPath.FindStringSubmatch(r.URL.Path) - if m == nil { - log.Printf("Invalid API request: %v", r.URL.Path) - http.Error(w, fmt.Errorf(r.URL.Path).Error(), http.StatusNotFound) - return - } - fn(w, r, m[2]) - } -} - -func apiHandler(w http.ResponseWriter, r *http.Request) { +func apiBaseHandler(w http.ResponseWriter, r *http.Request) { timerfc3339, err := time.Now().MarshalText() if err != nil { log.Printf("Couldn't format time as RFC3339: %v\n", err) @@ -35,3 +23,19 @@ func apiHandler(w http.ResponseWriter, r *http.Request) { log.Printf("Error writing to HTTP stream: %v\n", err) } } + +func indexHandler(w http.ResponseWriter, r *http.Request) { + +} +func apiFormatHandler(w http.ResponseWriter, r *http.Request) { + +} +func apiEndpointHandler(w http.ResponseWriter, r *http.Request) { + +} +func apiTagsBaseHandler(w http.ResponseWriter, r *http.Request) { + +} +func apiTagsHandler(w http.ResponseWriter, r *http.Request) { + +} |