Files
docker-cli/components/engine/api/server/router/network/network.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

27 lines
594 B
Go

package network
import (
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/server/router"
)
// networkRouter is a router to talk with the network controller
type networkRouter struct {
routes []router.Route
}
// Routes returns the available routes to the network controller
func (n networkRouter) Routes() []router.Route {
return n.routes
}
type networkRoute struct {
path string
handler httputils.APIFunc
}
// Handler returns the APIFunc to let the server wrap it in middlewares
func (l networkRoute) Handler() httputils.APIFunc {
return l.handler
}