package server import ( "encoding/json" "net/http" "github.com/go-chi/chi/v5" ) // xrpc router handles all xrpc methods func (s *Server) XRPCRouter() http.Handler { r := chi.NewRouter() return r } // helper to write xrpc errors func (s *Server) xrpcError(w http.ResponseWriter, errType, message string, status int) { w.Header().Set("Content-Type", "application/json") w.WriteHeader(status) json.NewEncoder(w).Encode(map[string]any{ "error": errType, "message": message, }) }