MCPcopy Create free account
hub / github.com/docker/go-plugins-helpers / NewHandler

Function NewHandler

sdk/handler.go:20–29  ·  view source on GitHub ↗

NewHandler creates a new Handler with an http mux.

(manifest string)

Source from the content-addressed store, hash-verified

18
19// NewHandler creates a new Handler with an http mux.
20func 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
32func (h Handler) Serve(l net.Listener) error {

Callers

nothing calls this directly

Calls 1

HandleFuncMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…