code: func New(config Config) (*Cluster, error) {
  	root := filepath.Join(config.Root, swarmDirName)
  	if err := os.MkdirAll(root, 0700); err != nil {
  		return nil, err
  	}
  	if config.RuntimeRoot == "" {
  		config.RuntimeRoot = root
  	}
  	if config.RaftHeartbeatTick == 0 {
  		config.RaftHeartbeatTick = 1
  	}
  	if config.RaftElectionTick == 0 {
  		// 10X heartbeat tick is the recommended ratio according to etcd docs.
  		config.RaftElectionTick = 10 * config.RaftHeartbeatTick
  	}
  
  	if err := os.MkdirAll(config.RuntimeRoot, 0700); err != nil {
  		return nil, err
  	}
  	c := &Cluster{
  		root:        root,
  		config:      config,
  		configEvent: make(chan lncluster.ConfigEventType, 10),
  		runtimeRoot: config.RuntimeRoot,
  		attachers:   make(map[string]*attacher),
  		watchStream: config.WatchStream,
  	}
  	return c, nil
  }
docs: // New creates a new Cluster instance using provided config.