NewHandler creates a new Handler with an http mux.
(manifest string)
| 18 | |
| 19 | // NewHandler creates a new Handler with an http mux. |
| 20 | func NewHandler(manifest string) Handler { |
| 21 | mux := http.NewServeMux() |
| 22 | |
| 23 | mux.HandleFunc(activatePath, func(w http.ResponseWriter, r *http.Request) { |
| 24 | w.Header().Set("Content-Type", DefaultContentTypeV1_1) |
| 25 | fmt.Fprintln(w, manifest) |
| 26 | }) |
| 27 | |
| 28 | return Handler{mux: mux} |
| 29 | } |
| 30 | |
| 31 | // Serve sets up the handler to serve requests on the passed in listener |
| 32 | func (h Handler) Serve(l net.Listener) error { |
nothing calls this directly
no test coverage detected
searching dependent graphs…