add api details in router comments

This commit is contained in:
Enot (ded) Skelly
2026-05-26 11:31:46 -07:00
parent 63c0ff37e1
commit 062a6e3381
4 changed files with 12 additions and 4 deletions
+3 -3
View File
@@ -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):
//
+4
View File
@@ -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) {
+1 -1
View File
@@ -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)
//
+4
View File
@@ -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) {