Documentation ¶
Index ¶
- Constants
- Variables
- type BlacklistSqls
- type ClientConn
- func (c *ClientConn) AddDatabase(nodeName string, role string, addr string) error
- func (c *ClientConn) Close() error
- func (c *ClientConn) DeleteDatabase(nodeName string, role string, addr string) error
- func (c *ClientConn) DownDatabase(nodeName string, role string, addr string) error
- func (c *ClientConn) GetExecDB(tokens []string, sql string) (*ExecuteDB, error)
- func (c *ClientConn) GetTransExecDB(tokens []string, sql string) (*ExecuteDB, error)
- func (c *ClientConn) Handshake() error
- func (c *ClientConn) IsAllowConnect() bool
- func (c *ClientConn) Run()
- func (c *ClientConn) UpDatabase(nodeName string, role string, addr string) error
- type Counter
- type ExecuteDB
- type ResultRow
- type Schema
- type Server
- func (s *Server) AddSlave(node string, addr string) error
- func (s *Server) Close()
- func (s *Server) DeleteSlave(node string, addr string) error
- func (s *Server) DownMaster(node, masterAddr string) error
- func (s *Server) DownSlave(node, slaveAddr string) error
- func (s *Server) GetNode(name string) *backend.Node
- func (s *Server) GetSchema() *Schema
- func (s *Server) Run() error
- func (s *Server) Status() string
- func (s *Server) UpMaster(node string, addr string) error
- func (s *Server) UpSlave(node string, addr string) error
- type Stmt
Constants ¶
View Source
const ( Master = "master" Slave = "slave" ServerRegion = "server" NodeRegion = "node" //op ADMIN_OPT_ADD = "add" ADMIN_OPT_DEL = "del" ADMIN_OPT_UP = "up" ADMIN_OPT_DOWN = "down" ADMIN_OPT_SHOW = "show" ADMIN_OPT_CHANGE = "change" ADMIN_SAVE_CONFIG = "save" ADMIN_PROXY = "proxy" ADMIN_NODE = "node" ADMIN_SCHEMA = "schema" ADMIN_LOG_SQL = "log_sql" ADMIN_SLOW_LOG_TIME = "slow_log_time" ADMIN_ALLOW_IP = "allow_ip" ADMIN_BLACK_SQL = "black_sql" ADMIN_CONFIG = "config" ADMIN_STATUS = "status" )
View Source
const ( MasterComment = "/*master*/" SumFunc = "sum" CountFunc = "count" MaxFunc = "max" MinFunc = "min" LastInsertIdFunc = "last_insert_id" FUNC_EXIST = 1 )
View Source
const ( Offline = iota Online Unknown )
Variables ¶
View Source
var DEFAULT_CAPABILITY uint32 = mysql.CLIENT_LONG_PASSWORD | mysql.CLIENT_LONG_FLAG | mysql.CLIENT_CONNECT_WITH_DB | mysql.CLIENT_PROTOCOL_41 | mysql.CLIENT_TRANSACTIONS | mysql.CLIENT_SECURE_CONNECTION
Functions ¶
This section is empty.
Types ¶
type BlacklistSqls ¶
type BlacklistSqls struct {
// contains filtered or unexported fields
}
BlacklistSqls black list will forbidden by ks
type ClientConn ¶
client <-> proxy
func (*ClientConn) AddDatabase ¶
func (c *ClientConn) AddDatabase(nodeName string, role string, addr string) error
func (*ClientConn) DeleteDatabase ¶
func (c *ClientConn) DeleteDatabase(nodeName string, role string, addr string) error
func (*ClientConn) DownDatabase ¶
func (c *ClientConn) DownDatabase(nodeName string, role string, addr string) error
func (*ClientConn) GetExecDB ¶
func (c *ClientConn) GetExecDB(tokens []string, sql string) (*ExecuteDB, error)
if sql need shard return nil, else return the unshard db
func (*ClientConn) GetTransExecDB ¶
func (c *ClientConn) GetTransExecDB(tokens []string, sql string) (*ExecuteDB, error)
func (*ClientConn) Handshake ¶
func (c *ClientConn) Handshake() error
func (*ClientConn) IsAllowConnect ¶
func (c *ClientConn) IsAllowConnect() bool
func (*ClientConn) UpDatabase ¶
func (c *ClientConn) UpDatabase(nodeName string, role string, addr string) error
type Counter ¶
type Counter struct { OldClientQPS int64 OldErrLogTotal int64 OldSlowLogTotal int64 ClientConns int64 ClientQPS int64 ErrLogTotal int64 SlowLogTotal int64 }
func (*Counter) DecrClientConns ¶
func (counter *Counter) DecrClientConns()
func (*Counter) IncrClientConns ¶
func (counter *Counter) IncrClientConns()
func (*Counter) IncrClientQPS ¶
func (counter *Counter) IncrClientQPS()
func (*Counter) IncrErrLogTotal ¶
func (counter *Counter) IncrErrLogTotal()
func (*Counter) IncrSlowLogTotal ¶
func (counter *Counter) IncrSlowLogTotal()
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema defineds sharding rules
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server the main struct for ks
func (*Server) DownMaster ¶
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
func (*Stmt) ResetParams ¶
func (s *Stmt) ResetParams()
Click to show internal directories.
Click to hide internal directories.