config

package
v0.0.0-...-20a187a Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogLevel                string              `yaml:"loglevel"`
	Hostname                string              `yaml:"hostname"`
	Mode                    string              `yaml:"mode"`
	AofMode                 string              `yaml:"aof_mode"`
	InfoFile                string              `yaml:"info_file"`
	MaintenanceFile         string              `yaml:"maintenance_file"`
	DaemonLockFile          string              `yaml:"daemon_lock_file"`
	PingStable              int                 `yaml:"ping_stable"`
	TickInterval            time.Duration       `yaml:"tick_interval"`
	InactivationDelay       time.Duration       `yaml:"inactivation_delay"`
	HealthCheckInterval     time.Duration       `yaml:"healthcheck_interval"`
	InfoFileHandlerInterval time.Duration       `yaml:"info_file_handler_interval"`
	PprofAddr               string              `yaml:"pprof_addr"`
	Zookeeper               dcs.ZookeeperConfig `yaml:"zookeeper"`
	DcsWaitTimeout          time.Duration       `yaml:"dcs_wait_timeout"`
	Redis                   RedisConfig         `yaml:"redis"`
	Renames                 RedisRenamesConfig  `yaml:"renames"`
	SentinelMode            SentinelModeConfig  `yaml:"sentinel_mode"`
}

Config contains rdsync application configuration

func DefaultConfig

func DefaultConfig() (Config, error)

DefaultConfig returns default configuration for RdSync

func ReadFromFile

func ReadFromFile(configFile string) (*Config, error)

ReadFromFile reads config from file (not set values are replaced by default ones)

type RedisConfig

type RedisConfig struct {
	Port                    int           `yaml:"port"`
	ClusterBusPort          int           `yaml:"cluster_bus_port"`
	UseTLS                  bool          `yaml:"use_tls"`
	TLSCAPath               string        `yaml:"tls_ca_path"`
	AuthUser                string        `yaml:"auth_user"`
	AuthPassword            string        `yaml:"auth_password"`
	DialTimeout             time.Duration `yaml:"dial_timeout"`
	ReadTimeout             time.Duration `yaml:"read_timeout"`
	WriteTimeout            time.Duration `yaml:"write_timeout"`
	DNSTTL                  time.Duration `yaml:"dns_ttl"`
	FailoverTimeout         time.Duration `yaml:"failover_timeout"`
	FailoverCooldown        time.Duration `yaml:"failover_cooldown"`
	RestartTimeout          time.Duration `yaml:"restart_timeout"`
	WaitReplicationTimeout  time.Duration `yaml:"wait_replication_timeout"`
	WaitCatchupTimeout      time.Duration `yaml:"wait_catchup_timeout"`
	WaitPromoteTimeout      time.Duration `yaml:"wait_promote_timeout"`
	WaitPromoteForceTimeout time.Duration `yaml:"wait_promote_force_timeout"`
	WaitPoisonPillTimeout   time.Duration `yaml:"wait_poison_pill_timeout"`
	MaxParallelSyncs        int           `yaml:"max_parallel_syncs"`
	AllowDataLoss           bool          `yaml:"allow_data_loss"`
	TurnBeforeSwitchover    bool          `yaml:"turn_before_switchover"`
	RestartCommand          string        `yaml:"restart_command"`
	AofPath                 string        `yaml:"aof_path"`
}

RedisConfig contains redis connection info and params

func DefaultRedisConfig

func DefaultRedisConfig() RedisConfig

DefaultRedisConfig returns default configuration for redis connection info and params

type RedisRenamesConfig

type RedisRenamesConfig struct {
	Client           string `yaml:"client"`
	Cluster          string `yaml:"cluster"`
	ClusterFailover  string `yaml:"cluster_failover"`
	ClusterMyID      string `yaml:"cluster_myid"`
	ClusterReplicate string `yaml:"cluster_replicate"`
	ClusterMeet      string `yaml:"cluster_meet"`
	Config           string `yaml:"config"`
	ReplicaOf        string `yaml:"replicaof"`
}

RedisRenamesConfig contains redis command renames

func DefaultRedisRenamesConfig

func DefaultRedisRenamesConfig() RedisRenamesConfig

DefaultRedisRenamesConfig returns default redis command renames

type SentinelModeConfig

type SentinelModeConfig struct {
	AnnounceHostname    bool   `yaml:"announce_hostname"`
	Name                string `yaml:"name"`
	RunID               string `yaml:"run_id"`
	ClusterName         string `yaml:"cluster_name"`
	CacheAuthUser       string `yaml:"cache_auth_user"`
	CacheAuthPassword   string `yaml:"cache_auth_password"`
	CachePort           int    `yaml:"cache_port"`
	CacheRestartCommand string `yaml:"cache_restart_command"`
	CacheUpdateSecret   string `yaml:"cache_update_secret"`
	UseTLS              bool   `yaml:"use_tls"`
	TLSCAPath           string `yaml:"tls_ca_path"`
}

SentinelModeConfig contains sentinel-mode specific configuration

func DefaultSentinelModeConfig

func DefaultSentinelModeConfig(hostname string) (SentinelModeConfig, error)

DefaultSentinelModeConfig returns default sentinel-mode specific configuration

Jump to

Keyboard shortcuts

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