config

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCobraCommand

func InitCobraCommand(runFunc func(cmd *cobra.Command, args []string)) *cobra.Command

Types

type ClusterConfig

type ClusterConfig struct {
	Namespace   string `mapstructure:"namespace"`
	NodeID      string `mapstructure:"node_id"`
	ServiceName string `mapstructure:"service_name"`
	JoinAddr    string `mapstructure:"join_addr"`
}

type Config

type Config struct {
	Profiling  ProfilingConfig
	Prometheus PrometheusConfig
	Logging    LoggingConfig
	Http       HttpConfig
	Grpc       GrpcConfig
	Raft       RaftConfig
	Storage    StorageConfig
	Queue      QueueConfig
	Cluster    ClusterConfig
}

func LoadConfig

func LoadConfig() (*Config, error)

func (*Config) BadgerOptions added in v0.3.4

func (config *Config) BadgerOptions() badger.Options

func (*Config) ConfigureLogger added in v0.3.4

func (config *Config) ConfigureLogger()

type GrpcConfig

type GrpcConfig struct {
	Address string `mapstructure:"address"`
}

type HttpConfig

type HttpConfig struct {
	Port string `mapstructure:"port"`
}

type LoggingConfig

type LoggingConfig struct {
	LogLevel string `mapstructure:"level"`
}

type ProfilingConfig

type ProfilingConfig struct {
	Enabled bool  `mapstructure:"enabled"`
	Port    int32 `mapstructure:"port"`
}

type PrometheusConfig added in v0.2.0

type PrometheusConfig struct {
	Enabled bool `mapstructure:"enabled"`
}

type QueueConfig

type QueueConfig struct {
	AcknowledgementCheckInterval int64            `mapstructure:"acknowledgement_check_interval"`
	AcknowledgementTimeout       int64            `mapstructure:"acknowledgement_timeout"`
	QueueStats                   QueueStatsConfig `mapstructure:"stats"`
}

type QueueStatsConfig added in v0.2.16

type QueueStatsConfig struct {
	WindowSide int `mapstructure:"window_side"`
}

type RaftConfig

type RaftConfig struct {
	Address      string `mapstructure:"address"`
	ApplyTimeout int64  `mapstructure:"apply_timeout"`
}

type StorageConfig

type StorageConfig struct {
	DataDir        string  `mapstructure:"data_dir"`
	GCInterval     int64   `mapstructure:"gc_interval"`
	GCDiscardRatio float64 `mapstructure:"gc_discard_ratio"`

	// BadgerDB options
	Compression             string `mapstructure:"compression"`
	ZSTDCompressionLevel    int    `mapstructure:"zstd_compression_level"`
	BlockCacheSize          int64  `mapstructure:"block_cache_size"`
	IndexCacheSize          int64  `mapstructure:"index_cache_size"`
	BaseTableSize           int64  `mapstructure:"base_table_size"`
	NumCompactors           int    `mapstructure:"num_compactors"`
	NumLevelZeroTables      int    `mapstructure:"num_level_zero_tables"`
	NumLevelZeroTablesStall int    `mapstructure:"num_level_zero_tables_stall"`
	NumMemtables            int    `mapstructure:"num_memtables"`
	ValueLogFileSize        int64  `mapstructure:"value_log_file_size"`
}

func (*StorageConfig) CompressionType added in v0.2.16

func (s *StorageConfig) CompressionType() options.CompressionType

Jump to

Keyboard shortcuts

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