plugin.go 490 B

1234567891011121314151617181920212223
  1. package plugin
  2. import "github.com/docker/docker/api/server/router"
  3. // pluginRouter is a router to talk with the plugin controller
  4. type pluginRouter struct {
  5. backend Backend
  6. routes []router.Route
  7. }
  8. // NewRouter initializes a new plugin router
  9. func NewRouter(b Backend) router.Router {
  10. r := &pluginRouter{
  11. backend: b,
  12. }
  13. r.initRoutes()
  14. return r
  15. }
  16. // Routes returns the available routers to the plugin controller
  17. func (r *pluginRouter) Routes() []router.Route {
  18. return r.routes
  19. }