Documentation ¶
Index ¶
Constants ¶
const HeaderLen = 4
const InProgress = 0xffff
const PacketNo = 3
Variables ¶
var ErrIncompletePacket = er.New("packet: incomplete packet")
ErrIncompletePacket the data being written didn't form a complete set of packets. Call aborted when it reached the incomplete packet.
Functions ¶
Types ¶
type Buffer ¶
Buffer buffers MySQL packets along with their times seen so they can be played back in order.
func (*Buffer) CurrentPacket ¶
type MySQLPacketWriter ¶
MySQLPacketWriter wraps a writer expecting MySQL packets and ensures that writer receives single MySQL packets for each Write call. Will return an error if it can't, or if the underlying writer errors.
func (*MySQLPacketWriter) Write ¶
func (w *MySQLPacketWriter) Write(data []byte) (n int, err error)
Write sends complete packets through as individual calls to Write on the Receiver. If there is incomplete data at the end it will return an ErrIncompletePacket and the number of bytes it did write. Note that the Receiver can also return an error.
type Splitter ¶
type Splitter struct {
// contains filtered or unexported fields
}
Splitter takes writes for the packets and ensures we emit full MySQL packets to the writer provided. This will buffer up data as necessary. To check if there was left over, call the IncompletePacket() function once done writing.
func NewSplitter ¶
func (*Splitter) CompressionDetected ¶
func (c *Splitter) CompressionDetected()
func (*Splitter) IncompletePacket ¶
type TimesSeen ¶
TimesSeen interface for something that gathers the times that data was seen. Due to the nature of how ip packets and then mysql packets, and then 'requests' and 'responses' etc. may not have a one to one relationship there may be multiple time stamps associated with parts of the data.