config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAppPath

func GetAppPath() (string, error)

GetAppPath return the working path for the app as root user, the result is `/root/.zj-db-cluster`

func GetCfgFilePath

func GetCfgFilePath(clusterName string) (string, error)

GetCfgFilePath ...

func ParseConfig

func ParseConfig(data string) error

ParseConfig return ClusterConfig instance

Types

type Atlas

type Atlas struct {
	IP   string
	Port int
}

Atlas ...

type ClusterConfig

type ClusterConfig struct {
	Username string `toml:"dbusername"`
	Password string `toml:"dbpassword"`

	Vip   Vip
	Atlas map[string]Atlas
	DB    map[string]Database `toml:"database"`
}

ClusterConfig ...

var Config ClusterConfig

type Database

type Database struct {
	IP   string
	Port int
}

Database ...

type Vip

type Vip struct {
	IP   string
	Port int
}

Vip ...

Jump to

Keyboard shortcuts

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