server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(readTimeout time.Duration, conf *config.Conf, logger *zap.SugaredLogger, sm *SessionManager) *Handler

func (*Handler) ComInitDB

func (h *Handler) ComInitDB(c *mysql.Conn, schemaName string) error

func (*Handler) ComPrepare

func (h *Handler) ComPrepare(c *mysql.Conn, query string) ([]*query.Field, error)

func (*Handler) ComQuery

func (h *Handler) ComQuery(
	c *mysql.Conn,
	query string,
	callback func(*sqltypes.Result) error,
) (err error)

func (*Handler) ComResetConnection

func (h *Handler) ComResetConnection(c *mysql.Conn)

func (*Handler) ComStmtExecute

func (h *Handler) ComStmtExecute(c *mysql.Conn, prepare *mysql.PrepareData, callback func(*sqltypes.Result) error) error

func (*Handler) ConnectionClosed

func (h *Handler) ConnectionClosed(c *mysql.Conn)

func (*Handler) NewConnection

func (h *Handler) NewConnection(c *mysql.Conn)

func (*Handler) WarningCount

func (h *Handler) WarningCount(c *mysql.Conn) uint16

type Listener

type Listener struct {
	net.Listener
	// contains filtered or unexported fields
}

func NewListener

func NewListener(protocol, address string, handler *Handler) (*Listener, error)

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

type Server

type Server struct {
	Listener *mysql.Listener
	// contains filtered or unexported fields
}

func NewServer

func NewServer(conf *config.Conf) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Start

func (s *Server) Start() error

type Session

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

func (*Session) GetDSN

func (s *Session) GetDSN() *ntunnel.DSN

func (*Session) SetDSN

func (s *Session) SetDSN(dsn string) (err error)

type SessionManager

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

func NewSessionManager

func NewSessionManager() *SessionManager

func (*SessionManager) DeleteSession

func (sm *SessionManager) DeleteSession(conn *mysql.Conn)

func (*SessionManager) GetSession

func (sm *SessionManager) GetSession(conn *mysql.Conn) *Session

func (*SessionManager) NewSession

func (sm *SessionManager) NewSession(conn *mysql.Conn)

Jump to

Keyboard shortcuts

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