Documentation
¶
Index ¶
- func ParseNodeList(cfgList []config.NodeConfig, schemaName string) (map[string]*Node, error)
- type Node
- func (n *Node) Execute(command string, fromSlave bool, args ...interface{}) (*mysql.Result, error)
- func (n *Node) GetDb(fromSlave bool) *backend.DB
- func (n *Node) GetMasterDb() (*backend.DB, error)
- func (n *Node) GetSlaveConn() (*backend.DB, error)
- func (n *Node) ParseMaster(masterStr string) error
- func (n *Node) ParseSlave(slaveList []string) error
- func (n *Node) String() string
- func (n *Node) UseDb(dbName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseNodeList ¶
Types ¶
type Node ¶
type Node struct {
Master *backend.DB
sync.RWMutex
SlaveList []*backend.DB
DownAfterNoAlive time.Duration
Cfg config.NodeConfig
DbName string
Online bool
}
func (*Node) ParseMaster ¶
func (*Node) ParseSlave ¶
ParseSlave slaveStr(127.0.0.1:3306@2,192.168.0.12:3306@3)
Click to show internal directories.
Click to hide internal directories.