MCPcopy Create free account
hub / github.com/evcc-io/evcc / deleteRemoteClientHandler

Function deleteRemoteClientHandler

server/http_remote_handler.go:53–62  ·  view source on GitHub ↗

deleteRemoteClientHandler removes a tunnel client by username. Username is passed as a query parameter to allow arbitrary characters.

(r *remote.Remote)

Source from the content-addressed store, hash-verified

51// deleteRemoteClientHandler removes a tunnel client by username.
52// Username is passed as a query parameter to allow arbitrary characters.
53func deleteRemoteClientHandler(r *remote.Remote) http.HandlerFunc {
54 return func(w http.ResponseWriter, req *http.Request) {
55 username := req.URL.Query().Get("username")
56 if err := r.DeleteClient(username); err != nil {
57 jsonError(w, http.StatusNotFound, err)
58 return
59 }
60 jsonWrite(w, true)
61 }
62}

Callers 1

RegisterSystemHandlerMethod · 0.85

Calls 5

QueryMethod · 0.80
DeleteClientMethod · 0.80
jsonErrorFunction · 0.70
jsonWriteFunction · 0.70
GetMethod · 0.65

Tested by

no test coverage detected