Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Protocol for the connection. Protocol string // Address of the server. Address string // Auth of the server. Auth mysql.AuthServer // Tracer to use in the server. By default, a noop tracer will be used if // no tracer is provided. Tracer opentracing.Tracer }
Config for the mysql server.
type DoneFunc ¶
type DoneFunc func()
DoneFunc is a function that must be executed when the session is used and it can be disposed.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a connection handler for a SQLe engine.
func NewHandler ¶
func NewHandler(e *sqle.Engine, sm *SessionManager) *Handler
NewHandler creates a new Handler given a SQLe engine.
func (*Handler) ComQuery ¶
func (h *Handler) ComQuery( c *mysql.Conn, query string, callback func(*sqltypes.Result) error, ) error
ComQuery executes a SQL query on the SQLe engine.
func (*Handler) ConnectionClosed ¶
ConnectionClosed reports that a connection has been closed.
func (*Handler) NewConnection ¶
NewConnection reports that a new connection has been established.
type Server ¶
Server is a MySQL server for SQLe engines.
func NewDefaultServer ¶
NewDefaultServer creates a Server with the default session builder.
type SessionBuilder ¶
SessionBuilder creates sessions given a context and a MySQL connection.
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager is in charge of creating new sessions for the given connections and keep track of which sessions are in each connection, so they can be cancelled is the connection is closed.
func NewSessionManager ¶
func NewSessionManager(builder SessionBuilder, tracer opentracing.Tracer) *SessionManager
NewSessionManager creates a SessionManager with the given ContextBuilder.
func (*SessionManager) CloseConn ¶
func (s *SessionManager) CloseConn(conn *mysql.Conn)
CloseConn closes the connection in the session manager and all its associated contexts, which are cancelled.
func (*SessionManager) NewContext ¶
NewContext creates a new context for the session at the given conn.
func (*SessionManager) NewSession ¶
func (s *SessionManager) NewSession(conn *mysql.Conn)
NewSession creates a Session for the given connection.