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