func NewRemoteAPI(addr string) *RemoteAPI { a := &RemoteAPI{ HTTPServer: graceful.NewHTTPServer("tcp", addr), } a.register( new(remoteV10), ) return a }
func NewPluginAPI(prefix string) *PluginAPI { os.MkdirAll(prefix, 0700) a := &PluginAPI{ HTTPServer: graceful.NewHTTPServer("unix", path.Join(prefix, socketName), accept), } a.Handle("POST", "/Plugin.Activate", a.activate) a.register( new(pluginVolume), ) return a }