chore(gofmt): Run gofmt
parent
c0ff8f6026
commit
91fc6aabd2
24
etcd.go
24
etcd.go
|
@ -111,25 +111,25 @@ func main() {
|
|||
|
||||
// Create peer server.
|
||||
psConfig := server.PeerServerConfig{
|
||||
Name: info.Name,
|
||||
Path: config.DataDir,
|
||||
URL: info.RaftURL,
|
||||
BindAddr: info.RaftListenHost,
|
||||
SnapshotCount: config.SnapshotCount,
|
||||
Name: info.Name,
|
||||
Path: config.DataDir,
|
||||
URL: info.RaftURL,
|
||||
BindAddr: info.RaftListenHost,
|
||||
SnapshotCount: config.SnapshotCount,
|
||||
HeartbeatTimeout: time.Duration(config.Peer.HeartbeatTimeout) * time.Millisecond,
|
||||
ElectionTimeout: time.Duration(config.Peer.ElectionTimeout) * time.Millisecond,
|
||||
MaxClusterSize: config.MaxClusterSize,
|
||||
RetryTimes: config.MaxRetryAttempts,
|
||||
CORS: corsInfo,
|
||||
ElectionTimeout: time.Duration(config.Peer.ElectionTimeout) * time.Millisecond,
|
||||
MaxClusterSize: config.MaxClusterSize,
|
||||
RetryTimes: config.MaxRetryAttempts,
|
||||
CORS: corsInfo,
|
||||
}
|
||||
ps := server.NewPeerServer(psConfig, &peerTLSConfig, &info.RaftTLS, registry, store, &mb)
|
||||
|
||||
// Create client server.
|
||||
sConfig := server.ServerConfig{
|
||||
Name: info.Name,
|
||||
URL: info.EtcdURL,
|
||||
Name: info.Name,
|
||||
URL: info.EtcdURL,
|
||||
BindAddr: info.EtcdListenHost,
|
||||
CORS: corsInfo,
|
||||
CORS: corsInfo,
|
||||
}
|
||||
s := server.New(sConfig, &tlsConfig, &info.EtcdTLS, ps, registry, store, &mb)
|
||||
|
||||
|
|
|
@ -40,19 +40,19 @@ type PeerServerConfig struct {
|
|||
}
|
||||
|
||||
type PeerServer struct {
|
||||
Config PeerServerConfig
|
||||
raftServer raft.Server
|
||||
server *Server
|
||||
httpServer *http.Server
|
||||
listener net.Listener
|
||||
joinIndex uint64
|
||||
tlsConf *TLSConfig
|
||||
tlsInfo *TLSInfo
|
||||
followersStats *raftFollowersStats
|
||||
serverStats *raftServerStats
|
||||
registry *Registry
|
||||
store store.Store
|
||||
snapConf *snapshotConf
|
||||
Config PeerServerConfig
|
||||
raftServer raft.Server
|
||||
server *Server
|
||||
httpServer *http.Server
|
||||
listener net.Listener
|
||||
joinIndex uint64
|
||||
tlsConf *TLSConfig
|
||||
tlsInfo *TLSInfo
|
||||
followersStats *raftFollowersStats
|
||||
serverStats *raftServerStats
|
||||
registry *Registry
|
||||
store store.Store
|
||||
snapConf *snapshotConf
|
||||
|
||||
closeChan chan bool
|
||||
timeoutThresholdChan chan interface{}
|
||||
|
|
|
@ -57,12 +57,12 @@ func New(sConfig ServerConfig, tlsConf *TLSConfig, tlsInfo *TLSInfo, peerServer
|
|||
TLSConfig: &tlsConf.Server,
|
||||
Addr: sConfig.BindAddr,
|
||||
},
|
||||
store: store,
|
||||
registry: registry,
|
||||
tlsConf: tlsConf,
|
||||
tlsInfo: tlsInfo,
|
||||
peerServer: peerServer,
|
||||
router: r,
|
||||
store: store,
|
||||
registry: registry,
|
||||
tlsConf: tlsConf,
|
||||
tlsInfo: tlsInfo,
|
||||
peerServer: peerServer,
|
||||
router: r,
|
||||
corsMiddleware: cors,
|
||||
metrics: mb,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue