2016-04-23 21:31:57 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
const daemonBinary = "dockerd"
|
|
|
|
|
|
|
|
// DaemonProxy acts as a cli.Handler to proxy calls to the daemon binary
|
|
|
|
type DaemonProxy struct{}
|
|
|
|
|
|
|
|
// NewDaemonProxy returns a new handler
|
|
|
|
func NewDaemonProxy() DaemonProxy {
|
|
|
|
return DaemonProxy{}
|
|
|
|
}
|
2016-04-29 11:16:34 -04:00
|
|
|
|
|
|
|
// Command returns a cli command handler if one exists
|
|
|
|
func (p DaemonProxy) Command(name string) func(...string) error {
|
|
|
|
return map[string]func(...string) error{
|
|
|
|
"daemon": p.CmdDaemon,
|
|
|
|
}[name]
|
|
|
|
}
|