From 062a6e33816ead95ce1e2729c9362a5ca73ee20d Mon Sep 17 00:00:00 2001 From: "Enot (ded) Skelly" Date: Tue, 26 May 2026 11:31:46 -0700 Subject: [PATCH] add api details in router comments --- internal/api/handlers/channels.go | 6 +++--- internal/api/handlers/iatas.go | 4 ++++ internal/api/handlers/messages.go | 2 +- internal/api/handlers/regions.go | 4 ++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/internal/api/handlers/channels.go b/internal/api/handlers/channels.go index 41b7e39..e88a1cf 100644 --- a/internal/api/handlers/channels.go +++ b/internal/api/handlers/channels.go @@ -18,7 +18,7 @@ import ( func ChannelsRouter(reader api.Reader) http.Handler { r := chi.NewRouter() - // ListChannels handles GET /api/v1/channels + // GET /api/v1/channels // // Query params (all optional): // @@ -59,7 +59,7 @@ func ChannelsRouter(reader api.Reader) http.Handler { }) r.Route("/{channelID}", func(r chi.Router) { - // GetChannel handles GET /api/v1/channels/{channelID} + // GET /api/v1/channels/{channelID} // // Returns channel detail including key for hashtag channels and message count. // Other channel keys are server-side config; key material is never exposed via the API. @@ -80,7 +80,7 @@ func ChannelsRouter(reader api.Reader) http.Handler { } respond(w, http.StatusOK, channel) }) - // ListChannelMessages handles GET /api/v1/channels/{channelID}/messages + // GET /api/v1/channels/{channelID}/messages // // Query params (all optional): // diff --git a/internal/api/handlers/iatas.go b/internal/api/handlers/iatas.go index 8a0aa44..e39c1a0 100644 --- a/internal/api/handlers/iatas.go +++ b/internal/api/handlers/iatas.go @@ -15,6 +15,8 @@ import ( func IATAsRouter(reader api.Reader) http.Handler { r := chi.NewRouter() + // GET /iatas → ListIATAs + // // Returns all known IATA codes with display name and coordinates where set. // IATAs are auto-created on first packet arrival; config file overrides name/coords. r.Get("/", func(w http.ResponseWriter, r *http.Request) { @@ -26,6 +28,8 @@ func IATAsRouter(reader api.Reader) http.Handler { respond(w, http.StatusOK, iatas) }) + // GET /iatas/{iata} → GetIATA + // // Returns detail for a single IATA code including associated region memberships // and basic recent stats. r.Get("/{iata}", func(w http.ResponseWriter, r *http.Request) { diff --git a/internal/api/handlers/messages.go b/internal/api/handlers/messages.go index 9a534e3..044159e 100644 --- a/internal/api/handlers/messages.go +++ b/internal/api/handlers/messages.go @@ -16,7 +16,7 @@ import ( func MessagesRouter(reader api.Reader) http.Handler { r := chi.NewRouter() - // ListMessages handles GET /api/v1/messages + // GET /api/v1/messages // // Query params (all optional) // diff --git a/internal/api/handlers/regions.go b/internal/api/handlers/regions.go index 30fa253..83408a4 100644 --- a/internal/api/handlers/regions.go +++ b/internal/api/handlers/regions.go @@ -19,6 +19,8 @@ import ( func RegionsRouter(reader api.Reader) http.Handler { r := chi.NewRouter() + // GET /regions → ListRegions + // // Returns all super-regions with their associated IATA codes, center // coordinates, and zoom level for map initialisation. r.Get("/", func(w http.ResponseWriter, r *http.Request) { @@ -29,6 +31,8 @@ func RegionsRouter(reader api.Reader) http.Handler { respond(w, http.StatusOK, regions) }) + // GET /regions/{regionId} → GetRegion + // // Returns detail for a single super-region including its full IATA membership // list and recent aggregate stats. r.Get("/{regionId}", func(w http.ResponseWriter, r *http.Request) {