forked from smancke/guble
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from cosminrentea/feature/disable-cluster
disable/enable the "cluster" feature from the build phase
- Loading branch information
Showing
9 changed files
with
93 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build cluster | ||
|
||
package server | ||
|
||
import ( | ||
|
2 changes: 2 additions & 0 deletions
2
server/redundancy_test.go → server/cluster_redundancy_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build cluster | ||
|
||
package server | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// +build !cluster | ||
|
||
package server | ||
|
||
import "github.com/cosminrentea/gobbler/server/cluster" | ||
|
||
func createCluster() *cluster.Cluster { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// +build cluster | ||
|
||
package server | ||
|
||
import "github.com/cosminrentea/gobbler/server/cluster" | ||
|
||
func createCluster() (cl *cluster.Cluster) { | ||
var err error | ||
|
||
if *Config.Cluster.NodeID > 0 { | ||
exitIfInvalidClusterParams(*Config.Cluster.NodeID, *Config.Cluster.NodePort, *Config.Cluster.Remotes) | ||
logger.Info("Starting in cluster-mode") | ||
cl, err = cluster.New(&cluster.Config{ | ||
ID: *Config.Cluster.NodeID, | ||
Port: *Config.Cluster.NodePort, | ||
Remotes: *Config.Cluster.Remotes, | ||
}) | ||
if err != nil { | ||
logger.WithField("err", err).Fatal("Module could not be started (cluster)") | ||
} | ||
} else { | ||
logger.Info("Starting in standalone-mode") | ||
} | ||
return | ||
} |