internal

package
v1.1.0-beta.0...-d5b6b69 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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

func NewPacketIOForTest(bufWriter *bufio.Writer) *PacketIO

NewPacketIOForTest creates a new PacketIO with given bufio.Writer.

func (*PacketIO) Flush

func (p *PacketIO) Flush() error

Flush flushes buffered data to network.

func (*PacketIO) ReadPacket

func (p *PacketIO) ReadPacket() ([]byte, error)

ReadPacket reads a packet from the connection.

func (*PacketIO) ResetBufWriter

func (p *PacketIO) ResetBufWriter(w io.Writer)

ResetBufWriter resets the bufio.Writer of PacketIO.

func (*PacketIO) Sequence

func (p *PacketIO) Sequence() uint8

Sequence returns the sequence of PacketIO.

func (*PacketIO) SetBufWriter

func (p *PacketIO) SetBufWriter(bufWriter *bufio.Writer)

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

func (p *PacketIO) SetCompressedSequence(s uint8)

SetCompressedSequence sets the compressed sequence of PacketIO.

func (*PacketIO) SetCompressionAlgorithm

func (p *PacketIO) SetCompressionAlgorithm(ca int)

SetCompressionAlgorithm sets the compression algorithm of PacketIO.

func (*PacketIO) SetMaxAllowedPacket

func (p *PacketIO) SetMaxAllowedPacket(maxAllowedPacket uint64)

SetMaxAllowedPacket sets the max allowed packet size of PacketIO.

func (*PacketIO) SetReadTimeout

func (p *PacketIO) SetReadTimeout(timeout time.Duration)

SetReadTimeout sets the read timeout of PacketIO.

func (*PacketIO) SetSequence

func (p *PacketIO) SetSequence(s uint8)

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

func (p *PacketIO) WritePacket(data []byte) error

WritePacket writes data that already have header

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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