expose federated event cursor transport

This commit is contained in:
kami
2026-07-26 20:34:47 +04:00
parent 17e7aef871
commit 6392e4e196
+8
View File
@@ -362,6 +362,14 @@ func main() {
w.WriteHeader(http.StatusCreated)
json.NewEncoder(w).Encode(worker)
})
mux.HandleFunc("/v1/federation/events", func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
http.Error(w, "method not allowed", 405)
return
}
cursor, _ := strconv.ParseUint(r.URL.Query().Get("since"), 10, 64)
json.NewEncoder(w).Encode(s.Events(cursor))
})
mux.HandleFunc("/v1/federation/workers/", func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost || !strings.HasSuffix(r.URL.Path, "/heartbeat") {
http.Error(w, "not found", 404)