config

package
v0.0.0-...-385b71e Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Simplified Chinese
	LANG_ZH_CN = "zh-cn"
	// English
	LANG_EN = "en"

	// Prometheus
	PROM_STORAGE_PROM = "prom"
	// VictoriaMetrics
	PROM_STORAGE_VM = "vm"

	// MySql
	DB_MYSQL = "mysql"
	// sqllite
	DB_SQLLITE = "sqllite"
)

Variables

This section is empty.

Functions

func GetCHCluster

func GetCHCluster() string

Types

type AnonymousUser

type AnonymousUser struct {
	Username string `mapstructure:"username"`
	Enable   bool   `mapstructure:"enable"`
	Role     string `mapstructure:"role"`
}

type Config

type Config struct {
	Server struct {
		Port int `mapstructure:"port"`
	} `mapstructure:"server"`
	Logger struct {
		Level         string `mapstructure:"level"`
		EnableConsole bool   `mapstructure:"console_enable"`
		EnableFile    bool   `mapstructure:"file_enable"`
		FilePath      string `mapstructure:"file_path"`
		FileNum       int    `mapstructure:"file_num"`
		FileSize      int    `mapstructure:"file_size_mb"`
	} `mapstructure:"logger"`
	Database struct {
		Connection string `mapstructure:"connection"`
		MaxOpen    int    `mapstructure:"max_open"`
		MaxIdle    int    `mapstructure:"max_idle"`
		MaxLife    int    `mapstructure:"max_life_second"`
		MySql      struct {
			Host     string `mapstructure:"host"`
			Port     int    `mapstructure:"port"`
			Database string `mapstructure:"database"`
			UserName string `mapstructure:"username"`
			Password string `mapstructure:"password"`
			Charset  string `mapstructure:"charset"`
		} `mapstructure:"mysql"`
		Sqllite struct {
			Database string `mapstructure:"database"`
		} `mapstructure:"sqllite"`
		InitScript struct {
			QuickMutationMetric    string `mapstructure:"quick_mutation_metric"`
			QuickAlertRuleMetric   string `mapstructure:"quick_alert_rule_metric"`
			DefaultAlertTagMapping string `mapstructure:"default_alert_tag_mapping"`
		} `mapstructure:"init_script"`
	} `mapstructure:"database"`
	ClickHouse struct {
		Address  string `mapstructure:"address"`
		Username string `mapstructure:"username"`
		Password string `mapstructure:"password"`
		Database string `mapstructure:"database"`
		Cluster  string `mapstructure:"cluster"`
		Replica  bool   `mapstructure:"replica"`
	} `mapstructure:"clickhouse"`
	Promethues struct {
		Address string `mapstructure:"address"`
		Storage string `mapstructure:"storage"`
	} `mapstructure:"promethues"`
	Kubernetes struct {
		AuthType     string `mapstructure:"auth_type"`
		AuthFilePath string `mapstructure:"auth_file_path"`

		MetadataSettings MetadataSettings `mapstructure:"metadata_settings"`
	} `mapstructure:"kubernetes"`
	Language struct {
		Local string `mapstructure:"local"`
	} `mapstructure:"language"`
	MetaServer struct {
		Enable           bool                     `mapstructure:"enable"`
		MetaSourceConfig configs.MetaSourceConfig `mapstructure:"meta_source_config"`
	} `mapstructure:"meta_server"`
	Jaeger struct {
		Address string `mapstructure:"address"`
	}
	DeepFlow struct {
		ServerAddress string `mapstructure:"server_address"`
		ChAddress     string `mapstructure:"ch_address"`
		ChUsername    string `mapstructure:"ch_username"`
		ChPassword    string `mapstructure:"ch_password"`
	} `mapstructure:"deepflow"`
	User struct {
		AnonymousUser `mapstructure:"anonymous_user"`
	} `mapstructure:"user"`
}

func Get

func Get() *Config

type MetadataSettings

type MetadataSettings struct {
	Namespace         string `mapstructure:"namespace"`
	AlertRuleCMName   string `mapstructure:"alert_rule_configmap_name"`
	AlertRuleFileName string `mapstructure:"alert_rule_file_name"`

	AlertManagerCMName   string `mapstructure:"alert_manager_configmap"`
	AlertManagerFileName string `mapstructure:"alert_manager_file_name"`
	VectorCMName         string `mapstructure:"vector_configmap"`
	VectorFileName       string `mapstructure:"vector_file_name"`
}

Jump to

Keyboard shortcuts

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