Documentation ¶
Index ¶
- Constants
- type Conn
- func NewBufferedConn(conn net.Conn, bufferSize int) *Conn
- func NewConn(conn net.Conn) *Conn
- func NewConnWithTimeout(conn net.Conn, readTimeout, writeTimeout time.Duration, bufferSize int) *Conn
- func NewTLSConn(conn net.Conn) *Conn
- func NewTLSConnWithTimeout(conn net.Conn, readTimeout, writeTimeout time.Duration) *Conn
- func (c *Conn) Close() error
- func (c *Conn) ReadPacket() ([]byte, error)
- func (c *Conn) ReadPacketReuseMem(dst []byte) ([]byte, error)
- func (c *Conn) ReadPacketTo(w io.Writer) error
- func (c *Conn) ResetSequence()
- func (c *Conn) WriteAuthSwitchPacket(authData []byte, addNUL bool) error
- func (c *Conn) WriteClearAuthPacket(password string) error
- func (c *Conn) WriteEncryptedPassword(password string, seed []byte, pub *rsa.PublicKey) error
- func (c *Conn) WritePacket(data []byte) error
- func (c *Conn) WritePublicKeyAuthPacket(password string, cipher []byte) error
Constants ¶
const DefaultBufferSize = 16 * 1024
const MinCompressionLength = 50
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { net.Conn Sequence uint8 Compression uint8 CompressedSequence uint8 // contains filtered or unexported fields }
Conn is the base class to handle MySQL protocol.
func NewConnWithTimeout ¶
func NewTLSConn ¶
func NewTLSConnWithTimeout ¶
func (*Conn) ReadPacket ¶
func (*Conn) ResetSequence ¶
func (c *Conn) ResetSequence()
func (*Conn) WriteAuthSwitchPacket ¶
WriteAuthSwitchPacket see https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_packets_protocol_auth_switch_response.html
func (*Conn) WriteClearAuthPacket ¶
WriteClearAuthPacket Client clear text authentication packet https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_packets_protocol_auth_switch_response.html
func (*Conn) WriteEncryptedPassword ¶
func (*Conn) WritePacket ¶
WritePacket data already has 4 bytes header will modify data in-place
func (*Conn) WritePublicKeyAuthPacket ¶
WritePublicKeyAuthPacket Caching sha2 authentication. Public key request and send encrypted password https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_packets_protocol_auth_switch_response.html