config

package
v0.0.0-...-c3123d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidValue = errors.New("invalid config value")
)

Functions

func Load

func Load(withDefaultAndFlags bool, paths ...string) (Config, Warnings, error)

Load loads the configuration from files and directories to a struct. Returns the config, warnings and an error.

func ParseFlags

func ParseFlags() (*pflag.FlagSet, error)

ParseFlags returns the parsed flags.

Types

type Aggregate

type Aggregate struct {
	IntendedDuration time.Duration `yaml:"intended_duration"`
}

type Batch

type Batch struct {
	Size time.Duration `yaml:"size"`
}

type Cassandra

type Cassandra struct {
	Addresses              []string      `yaml:"addresses"`
	Keyspace               string        `yaml:"keyspace"`
	ReplicationFactor      int           `yaml:"replication_factor"`
	DefaultTimeToLive      time.Duration `yaml:"default_time_to_live"`
	PreCreateShardDuration time.Duration `yaml:"pre_create_shard_duration"`
	PreCreateShardFraction int           `yaml:"pre_create_shard_fraction"`
	Aggregate              Aggregate     `yaml:"aggregate"`
	Username               string        `yaml:"username"`
	Password               string        `yaml:"password"`
	CertPath               string        `yaml:"cert_path"`
	KeyPath                string        `yaml:"key_path"`
	CAPath                 string        `yaml:"ca_path"`
	EnableHostVerification bool          `yaml:"enable_host_verification"`
}

type Config

type Config struct {
	Cassandra           Cassandra     `yaml:"cassandra"`
	Redis               Redis         `yaml:"redis"`
	ListenAddress       string        `yaml:"listen_address"`
	TenantLabelName     string        `yaml:"tenant_label_name"`
	RequireTenantHeader bool          `yaml:"require_tenant_header"`
	RemoteStorage       RemoteStorage `yaml:"remote_storage"`
	PromQL              PromQL        `yaml:"promql"`
	Batch               Batch         `yaml:"batch"`
	Log                 Log           `yaml:"log"`
	Sentry              Sentry        `yaml:"sentry"`
	Internal            Internal      `yaml:"internal"`
	Telemetry           Telemetry     `yaml:"telemetry"`
}

Config is the main structured configuration.

func DefaultConfig

func DefaultConfig() Config

type Installation

type Installation struct {
	Format string `yaml:"format"`
}

type Internal

type Internal struct {
	Index                   string       `yaml:"index"`
	IndexDummyCheckConflict bool         `yaml:"index_dummy_check_conflict"`
	IndexDummyFixedID       int          `yaml:"index_dummy_fixed_id"`
	Installation            Installation `yaml:"installation"`
	TSDB                    string       `yaml:"tsdb"`
	TemporaryStore          string       `yaml:"temporary_store"`
	Locks                   string       `yaml:"locks"`
	States                  string       `yaml:"states"`
	Store                   string       `yaml:"store"`
	MutableLabelsProvider   string       `yaml:"mutable_labels_provider"`
	DisablePreAggregation   bool         `yaml:"disable_pre_aggregation"`
	ReadOnly                bool         `yaml:"read_only"`
	UseThanosPromQLEngine   bool         `yaml:"use_thanos_promql_engine"`
}

type Log

type Log struct {
	Level        int  `yaml:"level"`
	DisableColor bool `yaml:"disable_color"`
}

type PromQL

type PromQL struct {
	MaxEvaluatedPoints int `yaml:"max_evaluated_points"`
	MaxEvaluatedSeries int `yaml:"max_evaluated_series"`
}

type Redis

type Redis struct {
	Addresses   []string `yaml:"addresses"`
	Username    string   `yaml:"username"`
	Password    string   `yaml:"password"`
	SSL         bool     `yaml:"ssl"`
	SSLInsecure bool     `yaml:"ssl_insecure"`
	CertPath    string   `yaml:"cert_path"`
	KeyPath     string   `yaml:"key_path"`
	CAPath      string   `yaml:"ca_path"`
	Keyspace    string   `yaml:"keyspace"`
}

type RemoteStorage

type RemoteStorage struct {
	MaxConcurrentRequests int `yaml:"max_concurrent_requests"`
}

type Sentry

type Sentry struct {
	DSN string `yaml:"dsn"`
}

type Telemetry

type Telemetry struct {
	Address string `yaml:"address"`
	Enabled bool   `yaml:"enabled"`
}

type Warnings

type Warnings error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL