config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2015 License: Apache-2.0 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 {
	Db      database `toml:"database"`
	Bin     binlog   `toml:"binlog"`
	Auth    auth
	Profile profile
}

func Load

func Load(fileName string) (*Config, error)

type MasterConfig

type MasterConfig struct {
	// contains filtered or unexported fields
}

func NewMasterConfig

func NewMasterConfig(dir string) *MasterConfig

func (*MasterConfig) GetMaster

func (mc *MasterConfig) GetMaster() MasterInfo

func (*MasterConfig) GetMasterUnit added in v1.0.3

func (mc *MasterConfig) GetMasterUnit() (bool, bool, uint16)

func (*MasterConfig) SetMaster

func (mc *MasterConfig) SetMaster(masterAddr, slaveAddr string) error

func (*MasterConfig) SetMigration

func (mc *MasterConfig) SetMigration(masterAddr, slaveAddr string, unitId uint16) error

func (*MasterConfig) SetStatus

func (mc *MasterConfig) SetStatus(status int) error

func (*MasterConfig) Status

func (mc *MasterConfig) Status() int

type MasterEncoding

type MasterEncoding struct {
	HasMaster bool // true: Has master; false: No master/No migration
	MasterInfo
	LastTime time.Time // Last change time
}

type MasterInfo

type MasterInfo struct {
	MasterAddr string // Master address ip:host
	SlaveAddr  string // This server address ip:host
	Migration  bool   // true: Migration; false: Normal master/slave
	UnitId     uint16 // Only meaningful for migration
	Status     int    // Status of Slave/Migration
}

Jump to

Keyboard shortcuts

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