config

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 3 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 {
	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)

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"`
}

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"`
}

type RaftConfig

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

type StorageConfig

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

Jump to

Keyboard shortcuts

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