Documentation ¶
Index ¶
- type PacketIO
- func (p *PacketIO) Flush() error
- func (p *PacketIO) ReadPacket() ([]byte, error)
- func (p *PacketIO) ResetBufWriter(w io.Writer)
- func (p *PacketIO) Sequence() uint8
- func (p *PacketIO) SetBufWriter(bufWriter *bufio.Writer)
- func (p *PacketIO) SetBufferedReadConn(bufReadConn *util.BufferedReadConn)
- func (p *PacketIO) SetCompressedSequence(s uint8)
- func (p *PacketIO) SetCompressionAlgorithm(ca int)
- func (p *PacketIO) SetMaxAllowedPacket(maxAllowedPacket uint64)
- func (p *PacketIO) SetReadTimeout(timeout time.Duration)
- func (p *PacketIO) SetSequence(s uint8)
- func (p *PacketIO) SetZstdLevel(level zstd.EncoderLevel)
- func (p *PacketIO) WritePacket(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PacketIO ¶
type PacketIO struct {
// contains filtered or unexported fields
}
PacketIO is a helper to read and write data in packet format. MySQL Packets: https://dev.mysql.com/doc/internals/en/mysql-packet.html
func NewPacketIO ¶
func NewPacketIO(bufReadConn *util.BufferedReadConn) *PacketIO
NewPacketIO creates a new PacketIO with given net.Conn.
func NewPacketIOForTest ¶
NewPacketIOForTest creates a new PacketIO with given bufio.Writer.
func (*PacketIO) ReadPacket ¶
ReadPacket reads a packet from the connection.
func (*PacketIO) ResetBufWriter ¶
ResetBufWriter resets the bufio.Writer of PacketIO.
func (*PacketIO) SetBufWriter ¶
SetBufWriter sets the bufio.Writer of PacketIO.
func (*PacketIO) SetBufferedReadConn ¶
func (p *PacketIO) SetBufferedReadConn(bufReadConn *util.BufferedReadConn)
SetBufferedReadConn sets the BufferedReadConn of PacketIO.
func (*PacketIO) SetCompressedSequence ¶
SetCompressedSequence sets the compressed sequence of PacketIO.
func (*PacketIO) SetCompressionAlgorithm ¶
SetCompressionAlgorithm sets the compression algorithm of PacketIO.
func (*PacketIO) SetMaxAllowedPacket ¶
SetMaxAllowedPacket sets the max allowed packet size of PacketIO.
func (*PacketIO) SetReadTimeout ¶
SetReadTimeout sets the read timeout of PacketIO.
func (*PacketIO) SetSequence ¶
SetSequence sets the sequence of PacketIO.
func (*PacketIO) SetZstdLevel ¶
func (p *PacketIO) SetZstdLevel(level zstd.EncoderLevel)
SetZstdLevel sets the zstd compression level.
func (*PacketIO) WritePacket ¶
WritePacket writes data that already have header