예제 #1
0
func NewRemoteAPI(addr string) *RemoteAPI {
	a := &RemoteAPI{
		HTTPServer: graceful.NewHTTPServer("tcp", addr),
	}
	a.register(
		new(remoteV10),
	)
	return a
}
예제 #2
0
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
}