@@ -3,10 +3,10 @@ package config
3
3
import (
4
4
"fmt"
5
5
"strconv"
6
+ "time"
6
7
7
8
"github.com/caraml-dev/mlp/api/pkg/instrumentation/newrelic"
8
9
"github.com/caraml-dev/mlp/api/pkg/instrumentation/sentry"
9
-
10
10
common_config "github.com/caraml-dev/xp/common/config"
11
11
common_mq_config "github.com/caraml-dev/xp/common/messagequeue"
12
12
"github.com/caraml-dev/xp/treatment-service/models"
@@ -24,16 +24,17 @@ type Config struct {
24
24
Port int `json:"port" default:"8080" validate:"required"`
25
25
ProjectIds []string `json:"project_ids" default:""`
26
26
27
- AssignedTreatmentLogger AssignedTreatmentLoggerConfig `json:"assigned_treatment_logger"`
28
- DebugConfig DebugConfig `json:"debug_config" validate:"required,dive"`
29
- NewRelicConfig newrelic.Config `json:"new_relic_config"`
30
- SentryConfig sentry.Config `json:"sentry_config"`
31
- DeploymentConfig DeploymentConfig `json:"deployment_config" validate:"required,dive"`
32
- MessageQueueConfig common_mq_config.MessageQueueConfig `json:"message_queue_config" validate:"required,dive"`
33
- ManagementService ManagementServiceConfig `json:"management_service" validate:"required,dive"`
34
- MonitoringConfig Monitoring `json:"monitoring_config"`
35
- SwaggerConfig SwaggerConfig `json:"swagger_config" validate:"required,dive"`
36
- SegmenterConfig map [string ]interface {} `json:"segmenter_config"`
27
+ AssignedTreatmentLogger AssignedTreatmentLoggerConfig `json:"assigned_treatment_logger"`
28
+ DebugConfig DebugConfig `json:"debug_config" validate:"required,dive"`
29
+ NewRelicConfig newrelic.Config `json:"new_relic_config"`
30
+ SentryConfig sentry.Config `json:"sentry_config"`
31
+ DeploymentConfig DeploymentConfig `json:"deployment_config" validate:"required,dive"`
32
+ MessageQueueConfig common_mq_config.MessageQueueConfig `json:"message_queue_config" validate:"required,dive"`
33
+ ManagementService ManagementServiceConfig `json:"management_service" validate:"required,dive"`
34
+ MonitoringConfig Monitoring `json:"monitoring_config"`
35
+ SwaggerConfig SwaggerConfig `json:"swagger_config" validate:"required,dive"`
36
+ SegmenterConfig map [string ]interface {} `json:"segmenter_config"`
37
+ ManagementServicePollerConfig ManagementServicePollerConfig `json:"management_service_poller_config" validate:"required,dive"`
37
38
}
38
39
39
40
type AssignedTreatmentLoggerConfig struct {
@@ -94,6 +95,11 @@ type ManagementServiceConfig struct {
94
95
AuthorizationEnabled bool `json:"authorization_enabled"`
95
96
}
96
97
98
+ type ManagementServicePollerConfig struct {
99
+ Enabled bool `default:"false"`
100
+ PollInterval time.Duration `default:"30s"`
101
+ }
102
+
97
103
func (c * Config ) GetProjectIds () []models.ProjectId {
98
104
projectIds := make ([]models.ProjectId , 0 )
99
105
for _ , projectIdString := range c .ProjectIds {
0 commit comments