Configure the nats service for the system storage extension

This commit is contained in:
André Duffeck
2022-05-18 09:03:28 +02:00
parent 66190e4b55
commit 2224855fc9
2 changed files with 16 additions and 8 deletions

View File

@@ -13,8 +13,9 @@ type Config struct {
Log *Log `yaml:"log"`
Debug Debug `yaml:"debug"`
GRPC GRPCConfig `yaml:"grpc"`
HTTP HTTPConfig `yaml:"http"`
GRPC GRPCConfig `yaml:"grpc"`
HTTP HTTPConfig `yaml:"http"`
Events Events `yaml:"events"`
TokenManager *TokenManager `yaml:"token_manager"`
Reva *Reva `yaml:"reva"`
@@ -77,3 +78,8 @@ type OCISDriver struct {
// Root is the absolute path to the location of the data
Root string `yaml:"root" env:"STORAGE_SYSTEM_OCIS_ROOT"`
}
type Events struct {
Addr string `yaml:"endpoint" env:"STORAGE_SYSTEM_EVENTS_ENDPOINT" desc:"the address of the streaming service"`
ClusterID string `yaml:"cluster" env:"STORAGE_SYSTEM_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"`
}

View File

@@ -47,12 +47,14 @@ func StorageUsersConfigFromStruct(cfg *config.Config) map[string]interface{} {
// TODO build services dynamically
"services": map[string]interface{}{
"dataprovider": map[string]interface{}{
"prefix": cfg.HTTP.Prefix,
"driver": cfg.Driver,
"drivers": UserDrivers(cfg),
"timeout": 86400,
"insecure": cfg.DataProviderInsecure,
"disable_tus": false,
"prefix": cfg.HTTP.Prefix,
"driver": cfg.Driver,
"drivers": UserDrivers(cfg),
"timeout": 86400,
"insecure": cfg.DataProviderInsecure,
"disable_tus": false,
"nats_address": cfg.Events.Addr,
"nats_clusterID": cfg.Events.ClusterID,
},
},
},