@@ -2,25 +2,26 @@ package internal
22
33// BaseConfig is the base honeycomb config.
44type BaseConfig struct {
5- ApiKey string `mapstructure:"api_key"`
6- DataSet string `mapstructure:"dataset"`
7- Type string `mapstructure:"type"`
8- Url string `mapstructure:"url"`
5+ ApiKey string `mapstructure:"api_key"`
6+ DataSet string `mapstructure:"dataset"`
7+ Type string `mapstructure:"type"`
8+ Url string `mapstructure:"url"`
9+ TrackDeployments bool `mapstructure:"track_deployments"`
910}
1011
1112type GlobalConfig struct {
1213 BaseConfig `mapstructure:",squash"`
1314}
1415
1516type SiteConfig struct {
16- BaseConfig `mapstructure:",squash"`
17- Components map [string ]* SiteComponentConfig `mapstructure:"-"`
17+ BaseConfig `mapstructure:",squash"`
18+ SiteComponents map [string ]* SiteComponentConfig `mapstructure:"-"`
1819}
1920
2021func (c * SiteConfig ) extendGlobalConfig (g * GlobalConfig ) * SiteConfig {
2122 cfg := & SiteConfig {
22- BaseConfig : g .BaseConfig ,
23- Components : c .Components ,
23+ BaseConfig : g .BaseConfig ,
24+ SiteComponents : c .SiteComponents ,
2425 }
2526
2627 if c .ApiKey != "" {
@@ -36,6 +37,10 @@ func (c *SiteConfig) extendGlobalConfig(g *GlobalConfig) *SiteConfig {
3637 cfg .Url = c .Url
3738 }
3839
40+ if c .TrackDeployments != false {
41+ cfg .TrackDeployments = c .TrackDeployments
42+ }
43+
3944 return cfg
4045}
4146
@@ -49,9 +54,6 @@ func (c *SiteComponentConfig) extendSiteConfig(s *SiteConfig) *SiteComponentConf
4954 BaseConfig : s .BaseConfig ,
5055 }
5156
52- if c .ApiKey != "" {
53- cfg .ApiKey = c .ApiKey
54- }
5557 if c .DataSet != "" {
5658 cfg .DataSet = c .DataSet
5759 }
@@ -62,6 +64,10 @@ func (c *SiteComponentConfig) extendSiteConfig(s *SiteConfig) *SiteComponentConf
6264 cfg .Url = c .Url
6365 }
6466
67+ if c .TrackDeployments != false {
68+ cfg .TrackDeployments = c .TrackDeployments
69+ }
70+
6571 return cfg
6672}
6773
0 commit comments