renew_handler.go 374 B

12345678910111213141516
  1. package lock
  2. import (
  3. "net/http"
  4. )
  5. // renewLockHandler attempts to update the TTL on an existing lock.
  6. // Returns a 200 OK if successful. Otherwie
  7. func (h *handler) renewLockHandler(w http.ResponseWriter, req *http.Request) {
  8. vars := mux.Vars(req)
  9. key := path.Join(prefix, vars["key"])
  10. ttl := vars["ttl"]
  11. w.Write([]byte(fmt.Sprintf("%s-%s", key, ttl)))
  12. // TODO:
  13. }