Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterMember ¶
type ClusterMemberLister ¶
type ClusterMemberLister interface {
Members() []ClusterMember
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server listens on a Unix socket and dispatches JSON-RPC requests to a vm.Manager.
func NewServer ¶
func NewServer(mgr vm.Manager, netStore *network.Store, svcMgr *service.Manager, endpoint string, shutdownFn func(), version string, clusterLister ClusterMemberLister) (*Server, error)
NewServer creates a Server that will listen on endpoint. The endpoint may carry a scheme (unix:// or tcp://); a bare value is treated as a Unix socket path. For unix endpoints any stale socket file is removed before binding. shutdownFn is called (in a goroutine) when a Daemon.Shutdown RPC is received; pass nil to disable remote shutdown. version is returned by Daemon.Version RPC; pass "" if unknown.
func (*Server) EnableImageBuild ¶
EnableImageBuild turns on the Image.Build RPC with a fixed mkfs function. It requires an image store (see SetImageStore). Mostly used in tests; the daemon uses EnableImageBuildResolver to resolve mkfs lazily.
func (*Server) EnableImageBuildResolver ¶
EnableImageBuildResolver turns on the Image.Build RPC with a resolver that produces the mkfs function on first use. This lets the daemon download the kernel toolchain on the first build instead of blocking startup. A successful result is cached; errors are not, so a failed download can be retried.
func (*Server) SetAuthToken ¶
SetAuthToken requires every connection to authenticate via an Auth.Hello handshake carrying token before any other method is dispatched. An empty token (the default) disables authentication. Call once before Serve.
func (*Server) SetImageStore ¶
SetImageStore attaches the daemon's image store, enabling image resolution for VM.Run as well as the Image.List and Image.Remove RPCs. Call once after NewServer, before Serve.