make cluster id configurable

This commit is contained in:
Willy Kloucek
2022-03-23 10:36:02 +01:00
parent 10f190d7f4
commit 09021c02a1
5 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ func DefaultConfig() *config.Config {
},
Events: config.Events{
Endpoint: "127.0.0.1:9233",
Cluster: "test-cluster",
Cluster: "ocis-cluster",
ConsumerGroup: "audit",
},
Auditlog: config.Auditlog{
+1 -1
View File
@@ -41,7 +41,7 @@ func Server(cfg *config.Config) *cli.Command {
[]nats.NatsOption{
nats.Host(cfg.Nats.Host),
nats.Port(cfg.Nats.Port),
nats.ClusterID("ocis-cluster"),
nats.ClusterID(cfg.Nats.ClusterID),
},
[]nats.JetStreamOption{
nats.JetStreamStoreDir(cfg.Nats.StoreDir),
+4 -3
View File
@@ -22,7 +22,8 @@ type Config struct {
// Nats is the nats config
type Nats struct {
Host string `ocisConfig:"host" env:"NATS_NATS_HOST"`
Port int `ocisConfig:"port" env:"NATS_NATS_PORT"`
StoreDir string `ocisConfig:"store_dir" env:"NATS_NATS_STORE_DIR"`
Host string `ocisConfig:"host" env:"NATS_NATS_HOST"`
Port int `ocisConfig:"port" env:"NATS_NATS_PORT"`
ClusterID string `ocisConfig:"clusterid" env:"NATS_NATS_CLUSTER_ID"`
StoreDir string `ocisConfig:"store_dir" env:"NATS_NATS_STORE_DIR"`
}
+4 -3
View File
@@ -25,9 +25,10 @@ func DefaultConfig() *config.Config {
Name: "nats",
},
Nats: config.Nats{
Host: "127.0.0.1",
Port: 9233,
StoreDir: path.Join(defaults.BaseDataPath(), "nats"),
Host: "127.0.0.1",
Port: 9233,
ClusterID: "ocis-cluster",
StoreDir: path.Join(defaults.BaseDataPath(), "nats"),
},
}
}
@@ -28,7 +28,7 @@ func DefaultConfig() *config.Config {
},
Events: config.Events{
Endpoint: "127.0.0.1:9233",
Cluster: "test-cluster",
Cluster: "ocis-cluster",
ConsumerGroup: "notifications",
},
RevaGateway: "127.0.0.1:9142",