You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
727 B

  1. // Package handlers contains the HTTP handlers for Go-NEB.
  2. //
  3. // This includes detail on the API paths and top-level JSON keys. For specific service JSON,
  4. // see the service you're interested in.
  5. //
  6. // See also
  7. //
  8. // Package "api" for the format of the JSON request bodies.
  9. package handlers
  10. import (
  11. "net/http"
  12. "github.com/matrix-org/util"
  13. )
  14. // Heartbeat implements the heartbeat API
  15. type Heartbeat struct{}
  16. // OnIncomingRequest returns an empty JSON object which can be used to detect liveness of Go-NEB.
  17. //
  18. // Request:
  19. // GET /test
  20. //
  21. //
  22. // Response:
  23. // HTTP/1.1 200 OK
  24. // {}
  25. func (*Heartbeat) OnIncomingRequest(req *http.Request) util.JSONResponse {
  26. return util.JSONResponse{
  27. Code: 200,
  28. JSON: struct{}{},
  29. }
  30. }