Documentation ¶
Index ¶
- Constants
- Variables
- func BuildSimpleSelectResult(value interface{}, name []byte, asName []byte) (*mysql.Resultset, error)
- func BuildSimpleShowResultset(values []interface{}, name string) (*mysql.Resultset, error)
- func ListenerInit(feConf *models.ListenerConfig, conf *models.Config, ...) (models.Listener, error)
- func NewHandlerSharded(conf *models.Config) (models.Listener, error)
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) ConnId() uint32
- func (c *Conn) HandleShowProxyConfig() (*mysql.Resultset, error)
- func (c *Conn) Handshake() error
- func (c *Conn) NewEmptyResultsetOLD(stmt *sqlparser.Select) *mysql.Resultset
- func (c *Conn) Run()
- func (c *Conn) UseDb(db string) error
- func (c *Conn) User() string
- func (c *Conn) WriteEOF(status uint16) error
- func (c *Conn) WriteError(e error) error
- func (c *Conn) WriteFieldList(status uint16, fs []*mysql.Field) error
- func (c *Conn) WriteHandlerResult(status uint16, r *mysql.Resultset) error
- func (c *Conn) WriteOK(r *mysql.Result) error
- func (c *Conn) WritePacket(data []byte) error
- func (c *Conn) WriteResult(r models.Result) error
- func (c *Conn) WriteResultset(status uint16, r *mysql.Resultset) error
- type HandlerSharded
- func (m *HandlerSharded) Close() error
- func (m *HandlerSharded) Handle(writer models.ResultWriter, req *models.Request) error
- func (m *HandlerSharded) Init(*models.ListenerConfig, *models.ServerCtx) error
- func (m *HandlerSharded) Run(stop chan bool) error
- func (m *HandlerSharded) SchemaUse(db string) *schema.Schema
- func (m *HandlerSharded) WriteOK(r *mysql.Result) error
- type HandlerShardedShared
- type Node
- type SchemaSharded
- type Stmt
Constants ¶
View Source
const ( Master = "master" Slave = "slave" )
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
View Source
var (
// or the listener type/name for this frontend connection
ListenerType = "mysql"
)
Functions ¶
func BuildSimpleSelectResult ¶
func ListenerInit ¶
func ListenerInit(feConf *models.ListenerConfig, conf *models.Config, sc models.StatementHandlerCreator) (models.Listener, error)
Types ¶
type Conn ¶
Conn serves as a Frontend (inbound listener) on mysql protocol
--> frontend --> handler --> backend
func (*Conn) HandleShowProxyConfig ¶
func (*Conn) NewEmptyResultsetOLD ¶
func (*Conn) Run ¶
func (c *Conn) Run()
Run is a blocking command PER client connection it is called AFTER Handshake()
-> listener.go:onConn() conn.go:onConn() <- handshake -> conn.go:Run() request/reply
func (*Conn) WriteError ¶
func (*Conn) WriteHandlerResult ¶
func (*Conn) WritePacket ¶
type HandlerSharded ¶
type HandlerSharded struct { // contains filtered or unexported fields }
Handle request splitting, a single connection session not threadsafe, not shared
func (*HandlerSharded) Close ¶
func (m *HandlerSharded) Close() error
func (*HandlerSharded) Handle ¶
func (m *HandlerSharded) Handle(writer models.ResultWriter, req *models.Request) error
func (*HandlerSharded) Init ¶
func (m *HandlerSharded) Init(*models.ListenerConfig, *models.ServerCtx) error
func (*HandlerSharded) Run ¶
func (m *HandlerSharded) Run(stop chan bool) error
type HandlerShardedShared ¶
type HandlerShardedShared struct {
// contains filtered or unexported fields
}
Handle request splitting, a single connection session not threadsafe, not shared
func (*HandlerShardedShared) Open ¶
func (m *HandlerShardedShared) Open(connI interface{}) models.StatementHandler
type Node ¶
Node describes a backend server endpoint and is responsible for creating connections to these backends as well as monitoring health of them
type SchemaSharded ¶
type SchemaSharded struct { *schema.SchemaSource // contains filtered or unexported fields }
Schema is the schema for a named database, shared across multiple nodes
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.