github.com/boynux/docker@v1.11.0-rc4/api/server/router/system/system.go (about)

     1  package system
     2  
     3  import "github.com/docker/docker/api/server/router"
     4  
     5  // systemRouter provides information about the Docker system overall.
     6  // It gathers information about host, daemon and container events.
     7  type systemRouter struct {
     8  	backend Backend
     9  	routes  []router.Route
    10  }
    11  
    12  // NewRouter initializes a new system router
    13  func NewRouter(b Backend) router.Router {
    14  	r := &systemRouter{
    15  		backend: b,
    16  	}
    17  
    18  	r.routes = []router.Route{
    19  		router.NewOptionsRoute("/{anyroute:.*}", optionsHandler),
    20  		router.NewGetRoute("/_ping", pingHandler),
    21  		router.NewGetRoute("/events", r.getEvents),
    22  		router.NewGetRoute("/info", r.getInfo),
    23  		router.NewGetRoute("/version", r.getVersion),
    24  		router.NewPostRoute("/auth", r.postAuth),
    25  	}
    26  
    27  	return r
    28  }
    29  
    30  // Routes returns all the API routes dedicated to the docker system
    31  func (s *systemRouter) Routes() []router.Route {
    32  	return s.routes
    33  }