From e950861e17edea99280fb4be02d875691319b4f1 Mon Sep 17 00:00:00 2001 From: Nick Hudson Date: Mon, 19 Dec 2022 11:41:25 -0600 Subject: [PATCH 1/2] add struct type tags for Config struct --- pkg/dataset/config.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/dataset/config.go b/pkg/dataset/config.go index f61c7f8b06..51e5d4041c 100644 --- a/pkg/dataset/config.go +++ b/pkg/dataset/config.go @@ -36,22 +36,22 @@ var ( // Config represents a dataset config. type Config struct { - Metrics - Traces + Metrics Metrics + Traces Traces } // Metrics contains dataset configuration options for metrics data. type Metrics struct { - ChunkInterval DayDuration `mapstructure:"default_chunk_interval" yaml:"default_chunk_interval"` - Compression *bool `mapstructure:"compress_data" yaml:"compress_data"` // Using pointer to check if the the value was set. - HALeaseRefresh DayDuration `mapstructure:"ha_lease_refresh" yaml:"ha_lease_refresh"` - HALeaseTimeout DayDuration `mapstructure:"ha_lease_timeout" yaml:"ha_lease_timeout"` - RetentionPeriod DayDuration `mapstructure:"default_retention_period" yaml:"default_retention_period"` + ChunkInterval DayDuration `mapstructure:"default_chunk_interval" yaml:"default_chunk_interval" json:"default_chunk_interval"` + Compression *bool `mapstructure:"compress_data" yaml:"compress_data" json:"compress_data"` // Using pointer to check if the the value was set. + HALeaseRefresh DayDuration `mapstructure:"ha_lease_refresh" yaml:"ha_lease_refresh" json:"ha_lease_refresh"` + HALeaseTimeout DayDuration `mapstructure:"ha_lease_timeout" yaml:"ha_lease_timeout" json:"ha_lease_timeout"` + RetentionPeriod DayDuration `mapstructure:"default_retention_period" yaml:"default_retention_period" json:"default_retention_period"` } // Traces contains dataset configuration options for traces data. type Traces struct { - RetentionPeriod DayDuration `mapstructure:"default_retention_period" yaml:"default_retention_period"` + RetentionPeriod DayDuration `mapstructure:"default_retention_period" yaml:"default_retention_period" json:"default_retention_period"` } // NewConfig creates a new dataset config based on the configuration YAML contents. From 0477a9d762a29bf183a61599d5f9263e8d4ecb62 Mon Sep 17 00:00:00 2001 From: Nick Hudson Date: Thu, 22 Dec 2022 13:47:07 -0600 Subject: [PATCH 2/2] add struct tags to dataset config --- pkg/dataset/config.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/dataset/config.go b/pkg/dataset/config.go index f61c7f8b06..2939d5e7ba 100644 --- a/pkg/dataset/config.go +++ b/pkg/dataset/config.go @@ -36,22 +36,22 @@ var ( // Config represents a dataset config. type Config struct { - Metrics - Traces + Metrics Metrics `mapstructure:"metrics" yaml:"metrics" json:"metrics"` + Traces Traces `mapstructure:"metrics" yaml:"traces" json:"traces"` } // Metrics contains dataset configuration options for metrics data. type Metrics struct { - ChunkInterval DayDuration `mapstructure:"default_chunk_interval" yaml:"default_chunk_interval"` - Compression *bool `mapstructure:"compress_data" yaml:"compress_data"` // Using pointer to check if the the value was set. - HALeaseRefresh DayDuration `mapstructure:"ha_lease_refresh" yaml:"ha_lease_refresh"` - HALeaseTimeout DayDuration `mapstructure:"ha_lease_timeout" yaml:"ha_lease_timeout"` - RetentionPeriod DayDuration `mapstructure:"default_retention_period" yaml:"default_retention_period"` + ChunkInterval DayDuration `mapstructure:"default_chunk_interval" yaml:"default_chunk_interval" json:"default_chunk_interval"` + Compression *bool `mapstructure:"compress_data" yaml:"compress_data" json:"compress_data"` // Using pointer to check if the the value was set. + HALeaseRefresh DayDuration `mapstructure:"ha_lease_refresh" yaml:"ha_lease_refresh" json:"ha_lease_refresh"` + HALeaseTimeout DayDuration `mapstructure:"ha_lease_timeout" yaml:"ha_lease_timeout" json:"ha_lease_timeout"` + RetentionPeriod DayDuration `mapstructure:"default_retention_period" yaml:"default_retention_period" json:"default_retention_period"` } // Traces contains dataset configuration options for traces data. type Traces struct { - RetentionPeriod DayDuration `mapstructure:"default_retention_period" yaml:"default_retention_period"` + RetentionPeriod DayDuration `mapstructure:"default_retention_period" yaml:"default_retention_period" json:"default_retention_period"` } // NewConfig creates a new dataset config based on the configuration YAML contents.