Documentation ¶
Overview ¶
Package wire provides encoding and decoding operation of MySQL packets.
Index ¶
- Constants
- func DecodePayload(ctx context.Context, logger *zap.Logger, data []byte, clientConn net.Conn, ...) (*mysql.PacketBundle, error)
- func EncodeToBinary(ctx context.Context, logger *zap.Logger, packet *mysql.PacketBundle, ...) ([]byte, error)
- func GetCachingSha2PasswordMechanism(data byte) (string, error)
- func GetPluginName(buf interface{}) (string, error)
- func IsGenericResponsePkt(packet *mysql.PacketBundle) bool
- func IsNoResponseCommand(command string) bool
- func PrintByteArray(name string, b []byte)
- func StringToCachingSha2PasswordMechanism(data string) (mysql.CachingSha2Password, error)
- type DecodeContext
- type LastOperation
- type ServerGreetings
Constants ¶
View Source
const RESET = 0x00
Variables ¶
This section is empty.
Functions ¶
func DecodePayload ¶
func DecodePayload(ctx context.Context, logger *zap.Logger, data []byte, clientConn net.Conn, decodeCtx *DecodeContext) (*mysql.PacketBundle, error)
DecodePayload is used to decode mysql packets that don't consist of multiple packets within them, because we are reading per packet.
func EncodeToBinary ¶
func GetPluginName ¶
func IsGenericResponsePkt ¶
func IsGenericResponsePkt(packet *mysql.PacketBundle) bool
func IsNoResponseCommand ¶
func PrintByteArray ¶
PrintByteArray is only for debugging purpose
func StringToCachingSha2PasswordMechanism ¶
func StringToCachingSha2PasswordMechanism(data string) (mysql.CachingSha2Password, error)
Types ¶
type DecodeContext ¶
type DecodeContext struct { Mode models.Mode LastOp *LastOperation PreparedStatements map[uint32]*mysql.StmtPrepareOkPacket ServerGreetings *ServerGreetings ClientCapabilities uint32 PluginName string UseSSL bool }
type LastOperation ¶
func NewLastOpMap ¶
func NewLastOpMap() *LastOperation
type ServerGreetings ¶
func NewGreetings ¶
func NewGreetings() *ServerGreetings
func (*ServerGreetings) Load ¶
func (sg *ServerGreetings) Load(key net.Conn) (*mysql.HandshakeV10Packet, bool)
func (*ServerGreetings) Store ¶
func (sg *ServerGreetings) Store(key net.Conn, value *mysql.HandshakeV10Packet)
Directories ¶
Path | Synopsis |
---|---|
Package phase contains the encoding and decoding functions for the different phases of the MySQL protocol.
|
Package phase contains the encoding and decoding functions for the different phases of the MySQL protocol. |
conn
Package conn provides decoding and encoding of connection phase mysql packets
|
Package conn provides decoding and encoding of connection phase mysql packets |
query
Package query provides functions to decode MySQL command phase packets.
|
Package query provides functions to decode MySQL command phase packets. |
query/preparedstmt
Package preparedstmt provides functionality for decoding prepared statement packets.
|
Package preparedstmt provides functionality for decoding prepared statement packets. |
query/rowscols
Package rowscols provides encoding and decoding of MySQL row & column packets.
|
Package rowscols provides encoding and decoding of MySQL row & column packets. |
query/utility
Package utility provides encoding and decoding of utility command packets.
|
Package utility provides encoding and decoding of utility command packets. |
Click to show internal directories.
Click to hide internal directories.