(w http.ResponseWriter, r *http.Request)
| 69 | } |
| 70 | |
| 71 | func handlerSearch(w http.ResponseWriter, r *http.Request) { |
| 72 | if r.Method != http.MethodGet { |
| 73 | writeResponse(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) |
| 74 | return |
| 75 | } |
| 76 | result := ®istry.SearchResults{ |
| 77 | Query: "fakequery", |
| 78 | NumResults: 1, |
| 79 | Results: []registry.SearchResult{{Name: "fakeimage", StarCount: 42}}, |
| 80 | } |
| 81 | writeResponse(w, result, http.StatusOK) |
| 82 | } |
| 83 | |
| 84 | func TestPing(t *testing.T) { |
| 85 | res, err := http.Get(makeURL("/v1/_ping")) |
nothing calls this directly
no test coverage detected
searching dependent graphs…