diff options
author | Ben Morrison <ben@gbmor.dev> | 2020-05-07 19:34:22 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2020-05-08 00:57:44 -0400 |
commit | e6ce5f3caaeeaebe2fce89a837c0d81d4d000fae (patch) | |
tree | 5fd2758cf63d736e68faec42854aeec00e782214 | |
parent | fa8162c2100ef2198b38879cc888c178e4e29185 (diff) | |
download | api-e6ce5f3caaeeaebe2fce89a837c0d81d4d000fae.tar.gz |
moved endpoint files out of internal module
-rw-r--r-- | http.go | 14 | ||||
-rw-r--r-- | osversion.go (renamed from internal/endpoints/osversion.go) | 2 | ||||
-rw-r--r-- | pkgs.go (renamed from internal/endpoints/pkgs.go) | 2 | ||||
-rw-r--r-- | query.go (renamed from internal/endpoints/query.go) | 2 | ||||
-rw-r--r-- | uptime.go (renamed from internal/endpoints/uptime.go) | 2 | ||||
-rw-r--r-- | usercount.go (renamed from internal/endpoints/usercount.go) | 2 | ||||
-rw-r--r-- | users.go (renamed from internal/endpoints/users.go) | 2 |
7 files changed, 12 insertions, 14 deletions
diff --git a/http.go b/http.go index 2350bea..0e3af0c 100644 --- a/http.go +++ b/http.go @@ -5,8 +5,6 @@ import ( "net/http" "strings" "time" - - "git.tilde.institute/tilde/api/internal/endpoints" ) const mimePlain = "text/plain; charset=utf-8" @@ -36,17 +34,17 @@ func validateRequest(w http.ResponseWriter, r *http.Request) { var err error switch routingHop(r) { case "pkgs": - err = endpoints.Pkgs(w, r, format) + err = Pkgs(w, r, format) case "query": - err = endpoints.Query(w, r, format) + err = Query(w, r, format) case "uptime": - err = endpoints.Uptime(w, r, format) + err = Uptime(w, r, format) case "usercount": - err = endpoints.UserCount(w, r, format) + err = UserCount(w, r, format) case "users": - err = endpoints.Users(w, r, format) + err = Users(w, r, format) case "osversion": - err = endpoints.OSVersion(w, r, format) + err = OSVersion(w, r, format) default: errHTTP(w, r, errors.New("Unknown endpoint"), http.StatusNotFound) return diff --git a/internal/endpoints/osversion.go b/osversion.go index da8ea87..24ac2c5 100644 --- a/internal/endpoints/osversion.go +++ b/osversion.go @@ -1,4 +1,4 @@ -package endpoints // import git.tilde.institute/tilde/api/internal/endpoints +package main import "net/http" diff --git a/internal/endpoints/pkgs.go b/pkgs.go index 018dea8..991ba53 100644 --- a/internal/endpoints/pkgs.go +++ b/pkgs.go @@ -1,4 +1,4 @@ -package endpoints // import git.tilde.institute/tilde/api/internal/endpoints +package main import "net/http" diff --git a/internal/endpoints/query.go b/query.go index c16cfed..03c9605 100644 --- a/internal/endpoints/query.go +++ b/query.go @@ -1,4 +1,4 @@ -package endpoints // import git.tilde.institute/tilde/api/internal/endpoints +package main import "net/http" diff --git a/internal/endpoints/uptime.go b/uptime.go index a50c3e6..10581f0 100644 --- a/internal/endpoints/uptime.go +++ b/uptime.go @@ -1,4 +1,4 @@ -package endpoints // import git.tilde.institute/tilde/api/internal/endpoints +package main import "net/http" diff --git a/internal/endpoints/usercount.go b/usercount.go index 1e76071..11a2674 100644 --- a/internal/endpoints/usercount.go +++ b/usercount.go @@ -1,4 +1,4 @@ -package endpoints // import git.tilde.institute/tilde/api/internal/endpoints +package main import "net/http" diff --git a/internal/endpoints/users.go b/users.go index e315793..7e1f40a 100644 --- a/internal/endpoints/users.go +++ b/users.go @@ -1,4 +1,4 @@ -package endpoints // import git.tilde.institute/tilde/api/internal/endpoints +package main import "net/http" |