Documentation ¶
Index ¶
- Variables
- func LoadAndSetBrokerConfig(cfgName, defaultPath string, brokerCfg *Broker) error
- func LoadAndSetRootConfig(cfgName, defaultPath string, rootCfg *Root) error
- func LoadAndSetStandAloneConfig(cfgName, defaultPath string, standaloneCfg *Standalone) error
- func LoadAndSetStorageConfig(cfgName, defaultPath string, storageCfg *Storage) error
- func NewDefaultBrokerTOML() string
- func NewDefaultRootTOML() string
- func NewDefaultStandaloneTOML() string
- func NewDefaultStorageTOML() string
- func PrintEnvFormat(v any)
- func SetGlobalBrokerConfig(brokerCfg *BrokerBase)
- func SetGlobalStorageConfig(storageCfg *StorageBase)
- type Broker
- type BrokerBase
- type BrokerCluster
- type Configuration
- type ETCD
- type GRPC
- type HTTP
- type Ingestion
- type Logging
- type Monitor
- type Query
- type RepoState
- type Root
- type Standalone
- type Storage
- type StorageBase
- type StorageCluster
- type TSDB
- type User
- type WAL
- type Write
Constants ¶
This section is empty.
Variables ¶
var ( // Version represents the release version of lindb(ldflags). Version = "unknown" // BuildTime represents binary build-time(ldflags). BuildTime = "unknown" )
These variables are populated via the Go linker.
var ( // StandaloneMode represents LinDB run as standalone mode StandaloneMode = false // Profile represents profiling Go programs with pprof Profile = false // Doc enables swagger api doc. Doc = false )
Functions ¶
func LoadAndSetBrokerConfig ¶
LoadAndSetBrokerConfig parses the broker config file this config will be triggered to reload when receiving a SIGHUP signal
func LoadAndSetRootConfig ¶ added in v0.2.4
LoadAndSetRootConfig parses the root config file. this config will be triggered to reload when receiving a SIGHUP signal
func LoadAndSetStandAloneConfig ¶
func LoadAndSetStandAloneConfig(cfgName, defaultPath string, standaloneCfg *Standalone) error
LoadAndSetStandAloneConfig parses the standalone config file then sets the global broker and storage config this config will be triggered to reload when receiving a SIGHUP signal
func LoadAndSetStorageConfig ¶
LoadAndSetStorageConfig parses the storage config file this config will be triggered to reload when receiving a SIGHUP signal
func NewDefaultBrokerTOML ¶
func NewDefaultBrokerTOML() string
NewDefaultBrokerTOML creates broker default toml config
func NewDefaultRootTOML ¶ added in v0.2.4
func NewDefaultRootTOML() string
NewDefaultBrokerTOML creates root default toml config.
func NewDefaultStandaloneTOML ¶
func NewDefaultStandaloneTOML() string
NewDefaultStandaloneTOML creates default toml config for standalone
func NewDefaultStorageTOML ¶
func NewDefaultStorageTOML() string
NewDefaultStorageTOML creates storage's default toml config
func PrintEnvFormat ¶ added in v0.2.4
func PrintEnvFormat(v any)
PrintEnvFormat prints config as env format.
func SetGlobalBrokerConfig ¶
func SetGlobalBrokerConfig(brokerCfg *BrokerBase)
SetGlobalBrokerConfig sets global broker configuration.
func SetGlobalStorageConfig ¶
func SetGlobalStorageConfig(storageCfg *StorageBase)
SetGlobalStorageConfig sets global storage configuration.
Types ¶
type Broker ¶
type Broker struct { Coordinator RepoState `envPrefix:"LINDB_COORDINATOR_" toml:"coordinator"` Query Query `envPrefix:"LINDB_QUERY_" toml:"query"` BrokerBase BrokerBase `envPrefix:"LINDB_BROKER_" toml:"broker"` Monitor Monitor `envPrefix:"LINDB_MONITOR_" toml:"monitor"` Logging Logging `envPrefix:"LINDB_LOGGING_" toml:"logging"` }
Broker represents a broker configuration with common settings
type BrokerBase ¶
type BrokerBase struct { SlowSQL ltoml.Duration `env:"SLOW_SQL" toml:"slow-sql"` HTTP HTTP `envPrefix:"HTTP_" toml:"http"` Ingestion Ingestion `envPrefix:"INGESTION_" toml:"ingestion"` Write Write `envPrefix:"WRITE_" toml:"write"` GRPC GRPC `envPrefix:"GRPC_" toml:"grpc"` }
BrokerBase represents a broker configuration
func GlobalBrokerConfig ¶
func GlobalBrokerConfig() *BrokerBase
GlobalBrokerConfig returns the global broker config
func NewDefaultBrokerBase ¶
func NewDefaultBrokerBase() *BrokerBase
func (*BrokerBase) TOML ¶
func (bb *BrokerBase) TOML() string
TOML returns broker's base configuration string as toml format.
type BrokerCluster ¶ added in v0.2.4
type BrokerCluster struct {
Config *RepoState `json:"config"`
}
BrokerCluster represents config of broker cluster.
type Configuration ¶
type Configuration interface { // TOML returns configuration string as toml format. TOML() string }
Configuration represents node's configuration.
type GRPC ¶
type GRPC struct { Port uint16 `env:"PORT" toml:"port"` MaxConcurrentStreams int `env:"MAX_CONCURRENT_STREAMS" toml:"max-concurrent-streams"` ConnectTimeout ltoml.Duration `env:"CONNECT_TIMEOUT" toml:"connect-timeout"` }
GRPC represents grpc server config
type HTTP ¶
type HTTP struct { Port uint16 `env:"PORT" toml:"port"` IdleTimeout ltoml.Duration `env:"IDLE_TIMEOUT" toml:"idle-timeout"` WriteTimeout ltoml.Duration `env:"WRITE_TIMEOUT" toml:"write-timeout"` ReadTimeout ltoml.Duration `env:"READ_TIMEOUT" toml:"read-timeout"` }
HTTP represents an HTTP level configuration of broker.
type Ingestion ¶
type Logging ¶
type Logging struct { Dir string `env:"DIR" toml:"dir"` Level string `env:"LEVEL" toml:"level"` MaxSize ltoml.Size `env:"MAX_SIZE" toml:"maxsize"` MaxBackups uint16 `env:"MAX_BACKUPS" toml:"maxbackups"` MaxAge uint16 `env:"MAX_AGE" toml:"maxage"` }
Logging represents a logging configuration
func NewDefaultLogging ¶
func NewDefaultLogging() *Logging
NewDefaultLogging returns a new default logging config
type Monitor ¶
type Monitor struct { PushTimeout ltoml.Duration `env:"PUSH_TIMEOUT" toml:"push-timeout"` ReportInterval ltoml.Duration `env:"REPORT_INTERVAL" toml:"report-interval"` URL string `env:"URL" toml:"url"` }
Monitor represents a configuration for the internal monitor
func NewDefaultMonitor ¶
func NewDefaultMonitor() *Monitor
NewDefaultMonitor returns a new default monitor config
type Query ¶
type Query struct { QueryConcurrency int `env:"CONCURRENCY" toml:"query-concurrency"` IdleTimeout ltoml.Duration `env:"IDLE_TIMEOUT" toml:"idle-timeout"` Timeout ltoml.Duration `env:"TIMEOUT" toml:"timeout"` }
Query represents query rpc config
func NewDefaultQuery ¶
func NewDefaultQuery() *Query
type RepoState ¶
type RepoState struct { Namespace string `env:"NAMESPACE" toml:"namespace" json:"namespace" validate:"required"` Endpoints []string `env:"ENDPOINTS" envSeparator:"," toml:"endpoints" json:"endpoints" validate:"required,gt=0"` LeaseTTL ltoml.Duration `env:"LEASE_TTL" toml:"lease-ttl" json:"leaseTTL"` Timeout ltoml.Duration `env:"TIMEOUT" toml:"timeout" json:"timeout"` DialTimeout ltoml.Duration `env:"DIAL_TIMEOUT" toml:"dial-timeout" json:"dialTimeout"` Username string `env:"USERNAME" toml:"username" json:"username"` Password string `env:"PASSWORD" toml:"password" json:"password"` }
RepoState represents state repository config
func NewDefaultCoordinator ¶
func NewDefaultCoordinator() *RepoState
func (*RepoState) WithSubNamespace ¶
type Root ¶ added in v0.2.4
type Root struct { Coordinator RepoState `envPrefix:"LINDB_COORDINATOR_" toml:"coordinator"` Query Query `envPrefix:"LINDB_QUERY_" toml:"query"` HTTP HTTP `envPrefix:"LINDB_ROOT_HTTP_" toml:"http"` Monitor Monitor `envPrefix:"LINDB_MONITOR_" toml:"monitor"` Logging Logging `envPrefix:"LINDB_LOGGING_" toml:"logging"` }
Root represents a root configuration with common settings.
func NewDefaultRoot ¶ added in v0.2.4
func NewDefaultRoot() *Root
NewDefaultRoot creates root default config.
type Standalone ¶
type Standalone struct { ETCD ETCD `envPrefix:"LINDB_ETCD_" toml:"etcd"` Coordinator RepoState `envPrefix:"LINDB_COORDINATOR_" toml:"coordinator"` Query Query `envPrefix:"LINDB_QUERY_" toml:"query"` BrokerBase BrokerBase `envPrefix:"LINDB_BROKER_" toml:"broker"` StorageBase StorageBase `envPrefix:"LINDB_STORAGE_" toml:"storage"` Logging Logging `envPrefix:"LINDB_LOGGING_" toml:"logging"` Monitor Monitor `envPrefix:"LINDB_MONITOR_" toml:"monitor"` }
Standalone represents the configuration of standalone mode
func NewDefaultStandalone ¶
func NewDefaultStandalone() Standalone
NewDefaultStandalone creates standalone default configuration.
type Storage ¶
type Storage struct { Coordinator RepoState `envPrefix:"LINDB_COORDINATOR_" toml:"coordinator"` Query Query `envPrefix:"LINDB_QUERY_" toml:"query"` StorageBase StorageBase `envPrefix:"LINDB_STORAGE_" toml:"storage"` Monitor Monitor `envPrefix:"LINDB_MONITOR_" toml:"monitor"` Logging Logging `envPrefix:"LINDB_LOGGING_" toml:"logging"` }
Storage represents a storage configuration with common settings
type StorageBase ¶
type StorageBase struct { // Broker http endpoint, auto register current storage cluster. BrokerEndpoint string `env:"BROKER_ENDPOINT" toml:"broker-endpoint"` TTLTaskInterval ltoml.Duration `env:"TTL_TASK_INTERVAL" toml:"ttl-task-interval"` HTTP HTTP `envPrefix:"HTTP_" toml:"http"` GRPC GRPC `envPrefix:"GRPC_" toml:"grpc"` TSDB TSDB `envPrefix:"TSDB_" toml:"tsdb"` WAL WAL `envPrefix:"WAL_" toml:"wal"` }
StorageBase represents a storage configuration
func GlobalStorageConfig ¶
func GlobalStorageConfig() *StorageBase
GlobalStorageConfig returns the global storage config
func NewDefaultStorageBase ¶
func NewDefaultStorageBase() *StorageBase
NewDefaultStorageBase returns a new default StorageBase struct
func (*StorageBase) TOML ¶
func (s *StorageBase) TOML() string
TOML returns StorageBase's toml config string
type StorageCluster ¶
type StorageCluster struct {
Config *RepoState `json:"config"`
}
StorageCluster represents config of storage cluster.
type TSDB ¶
type TSDB struct { Dir string `env:"DIR" toml:"dir"` MaxMemDBSize ltoml.Size `env:"MAX_MEMDB_SIZE" toml:"max-memdb-size"` MutableMemDBTTL ltoml.Duration `env:"MUTABLE_MEMDB_TTL" toml:"mutable-memdb-ttl"` MaxMemUsageBeforeFlush float64 `env:"MAX_MEM_USAGE_BEFORE_FLUSH" toml:"max-mem-usage-before-flush"` TargetMemUsageAfterFlush float64 `env:"TARGET_MEM_USAGE_AFTER_FLUSH" toml:"target-mem-usage-after-flush"` FlushConcurrency int `env:"FLUSH_CONCURRENCY" toml:"flush-concurrency"` SeriesSequenceCache uint32 `env:"SERIES_SEQ_CACHE" toml:"series-sequence-cache"` MetaSequenceCache uint32 `env:"META_SEQ_CACHE" toml:"meta-sequence-cache"` }
TSDB represents the tsdb configuration.
type User ¶
type User struct { UserName string `toml:"username" json:"username" binding:"required"` Password string `toml:"password" json:"password" binding:"required"` }
User represents user model
type WAL ¶
type WAL struct { Dir string `env:"DIR" toml:"dir"` DataSizeLimit ltoml.Size `env:"DATA_SIZE_LIMIT" toml:"data-size-limit"` RemoveTaskInterval ltoml.Duration `env:"REMOVE_TASK_INTERVAL" toml:"remove-task-interval"` }
WAL represents config for write ahead log in storage.
func (*WAL) GetDataSizeLimit ¶
type Write ¶
type Write struct { BatchTimeout ltoml.Duration `env:"BATCH_TIMEOUT" toml:"batch-timeout"` BatchBlockSize ltoml.Size `env:"BLOCK_SIZE" toml:"batch-block-size"` GCTaskInterval ltoml.Duration `env:"GC_INTERVAL" toml:"gc-task-interval"` }
Write represents config for write replication in broker.