Files
docker-cli/components/engine/api/server/server_windows.go
David Calavera 1fb74bb17c Separate API router from server.
Implement basic interfaces to write custom routers that can be plugged
to the server. Remove server coupling with the daemon.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: da982cf5511814b6897244ecaa9c016f8800340a
Component: engine
2015-09-29 19:43:03 -04:00

45 lines
722 B
Go

// +build windows
package server
import (
"errors"
"net"
"net/http"
)
// NewServer sets up the required Server and does protocol specific checking.
func (s *Server) newServer(proto, addr string) ([]serverCloser, error) {
var (
ls []net.Listener
)
switch proto {
case "tcp":
l, err := s.initTCPSocket(addr)
if err != nil {
return nil, err
}
ls = append(ls, l)
default:
return nil, errors.New("Invalid protocol format. Windows only supports tcp.")
}
var res []serverCloser
for _, l := range ls {
res = append(res, &HTTPServer{
&http.Server{
Addr: addr,
Handler: s.CreateMux(),
},
l,
})
}
return res, nil
}
func allocateDaemonPort(addr string) error {
return nil
}