config

package
v0.0.0-...-7d81075 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2016 License: MPL-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//
	Conf = Config{
		AdvertisePort:   4400,
		PGPort:          5432,
		DataDir:         "/data/",
		StatusDir:       "./status/",
		SyncCommand:     "rsync -a --delete {{local_dir}} {{slave_ip}}:{{slave_dir}}",
		DecisionTimeout: 10,
		SystemUser:      SystemUser(),
	}

	//
	Log = lumber.NewConsoleLogger(lumber.INFO)
)

establish constants these are singleton values that are used throughout the package.

Functions

func ConfigureHBAConf

func ConfigureHBAConf(ip string) error

configureHBAConf attempts to open the 'pg_hba.conf' file. Once open it will scan the file line by line looking for replication settings, and overwrite only those settings with the settings required for redundancy on Yoke

func ConfigurePGConf

func ConfigurePGConf(ip string, port int) error

configurePGConf attempts to open the 'postgresql.conf' file. Once open it will scan the file line by line looking for replication settings, and overwrite only those settings with the settings required for redundancy

func Init

func Init(path string)

init Initializeds the config file and the other constants

func SystemUser

func SystemUser() string

Types

type Config

type Config struct {
	Role              string
	AdvertiseIp       string
	AdvertisePort     int
	PGPort            int
	Monitor           string
	Primary           string
	Secondary         string
	DataDir           string
	StatusDir         string
	SyncCommand       string
	DecisionTimeout   int
	Vip               string
	VipAddCommand     string
	VipRemoveCommand  string
	RoleChangeCommand string
	SystemUser        string
}

Config is the struct of all global configuration data it is set by a config file that is the first arguement given to the exec

Jump to

Keyboard shortcuts

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