config

package
v0.0.0-...-681de73 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 10 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 {
	*sync.Mutex `yaml:"-"`

	MinVerSQLPromote       float64            `yaml:"-"`
	TimeoutWaitPromoteSec  int                `yaml:"-"`
	HostStatusIntervalSec  int                `yaml:"host_status_interval"`
	CheckMasterIntervalSec int                `yaml:"check_master_interval"`
	FailoverTimeoutSec     int                `yaml:"failover_timeout"`
	TimeoutMasterDialSec   int                `yaml:"master_dial_timeout"`
	Listen                 string             `yaml:"listen"`
	ShardListen            string             `yaml:"shard_listen"`
	PgUser                 string             `yaml:"pg_user"`
	PgPasswd               string             `yaml:"pg_passwd"`
	PrometheusListenPort   string             `yaml:"prometheus_listen_port"`
	Servers                map[string]*Server `yaml:"servers,omitempty"`
	// contains filtered or unexported fields
}

Config ...

func NewConfig

func NewConfig(configFile, etcdAddress, etcdKey string) (*Config, error)

NewConfig ...

func (*Config) Save

func (s *Config) Save() error

Save ...

type Server

type Server struct {
	Address            string `yaml:"address"`
	Command            string `yaml:"command,omitempty"`
	PostPromoteCommand string `yaml:"post_promote_command,omitempty"`
	PgConn             string `yaml:"-"`
	Use                bool   `yaml:"use"`
	Host               string `yaml:"-"`
	Port               string `yaml:"-"`
}

Server ...

Jump to

Keyboard shortcuts

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