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

Method ServeWindows

sdk/handler.go:74–83  ·  view source on GitHub ↗

ServeWindows makes the handler to listen for request in a Windows named pipe. It also creates the spec file in the right directory for docker to read. Due to constrains for running Docker in Docker on Windows, data-root directory of docker daemon must be provided. To get default directory, use Windo

(addr, pluginName, daemonDir string, pipeConfig *WindowsPipeConfig)

Source from the content-addressed store, hash-verified

72// of docker daemon must be provided. To get default directory, use
73// WindowsDefaultDaemonRootDir() function. On Unix, this parameter is ignored.
74func (h Handler) ServeWindows(addr, pluginName, daemonDir string, pipeConfig *WindowsPipeConfig) error {
75 l, spec, err := newWindowsListener(addr, pluginName, daemonDir, pipeConfig)
76 if err != nil {
77 return err
78 }
79 if spec != "" {
80 defer os.Remove(spec)
81 }
82 return h.Serve(l)
83}
84
85// HandleFunc registers a function to handle a request path with.
86func (h Handler) HandleFunc(path string, fn func(w http.ResponseWriter, r *http.Request)) {

Callers

nothing calls this directly

Calls 3

ServeMethod · 0.95
newWindowsListenerFunction · 0.70
RemoveMethod · 0.65

Tested by

no test coverage detected