etcdserver: clean NewServer
This commit is contained in:
@ -3,6 +3,7 @@ package etcdserver
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"path"
|
||||
|
||||
"github.com/coreos/etcd/pkg/types"
|
||||
)
|
||||
@ -40,3 +41,14 @@ func (c *ServerConfig) Verify() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *ServerConfig) WALDir() string { return path.Join(c.DataDir, "wal") }
|
||||
|
||||
func (c *ServerConfig) SnapDir() string { return path.Join(c.DataDir, "snap") }
|
||||
|
||||
func (c *ServerConfig) ID() uint64 { return c.Cluster.FindName(c.Name).ID }
|
||||
|
||||
// IsBootstrap returns ture if a bootstrap method is provided.
|
||||
func (c *ServerConfig) IsBootstrap() bool {
|
||||
return c.DiscoveryURL != "" || c.ClusterState == ClusterStateValueNew
|
||||
}
|
||||
|
Reference in New Issue
Block a user