capability_handler.go 331 B

123456789101112131415
  1. package api
  2. import (
  3. "encoding/json"
  4. "net/http"
  5. )
  6. // HandleGetCapabilities gets the capabilities of the server
  7. func (app *App) HandleGetCapabilities(w http.ResponseWriter, r *http.Request) {
  8. if err := json.NewEncoder(w).Encode(app.Capabilities); err != nil {
  9. app.handleErrorFormDecoding(err, ErrK8sDecode, w)
  10. return
  11. }
  12. }