config api
(w http.ResponseWriter, r *http.Request, getf, setf http.HandlerFunc)
| 1000 | |
| 1001 | // config api |
| 1002 | func apiConfigMethod(w http.ResponseWriter, r *http.Request, getf, setf http.HandlerFunc) { |
| 1003 | switch r.Method { |
| 1004 | case http.MethodHead: |
| 1005 | return |
| 1006 | case http.MethodGet: |
| 1007 | getf(w, r) |
| 1008 | case http.MethodPost: |
| 1009 | setf(w, r) |
| 1010 | |
| 1011 | default: |
| 1012 | apiError(w, http.StatusBadRequest, BadMethod) |
| 1013 | } |
| 1014 | } |
| 1015 | |
| 1016 | // GET /config/dir |
| 1017 | // POST /config/dir |
no test coverage detected
searching dependent graphs…