Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Add struct tags to dataset config objects #1807

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pkg/dataset/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down