@@ -3,10 +3,10 @@ package config
33import (
44 "fmt"
55 "strconv"
6+ "time"
67
78 "github.com/caraml-dev/mlp/api/pkg/instrumentation/newrelic"
89 "github.com/caraml-dev/mlp/api/pkg/instrumentation/sentry"
9-
1010 common_config "github.com/caraml-dev/xp/common/config"
1111 common_mq_config "github.com/caraml-dev/xp/common/messagequeue"
1212 "github.com/caraml-dev/xp/treatment-service/models"
@@ -24,16 +24,17 @@ type Config struct {
2424 Port int `json:"port" default:"8080" validate:"required"`
2525 ProjectIds []string `json:"project_ids" default:""`
2626
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"`
3738}
3839
3940type AssignedTreatmentLoggerConfig struct {
@@ -94,6 +95,11 @@ type ManagementServiceConfig struct {
9495 AuthorizationEnabled bool `json:"authorization_enabled"`
9596}
9697
98+ type ManagementServicePollerConfig struct {
99+ Enabled bool `default:"false"`
100+ PollInterval time.Duration `default:"30s"`
101+ }
102+
97103func (c * Config ) GetProjectIds () []models.ProjectId {
98104 projectIds := make ([]models.ProjectId , 0 )
99105 for _ , projectIdString := range c .ProjectIds {
0 commit comments