Documentation ¶
Index ¶
- Constants
- func ReadFirstBuffer(clientConn, destConn net.Conn) ([]byte, string, error)
- func ReadLengthEncodedIntegers(data []byte, offset int) (uint64, int)
- func Uint24(data []byte) uint32
- type AuthSwitchRequestPacket
- type AuthSwitchResponsePacket
- type BoundParameter
- type COM_STMT_RESET
- type COM_STMT_SEND_LONG_DATA
- type CapabilityFlags
- type ColumnDefinition
- type ComChangeUserPacket
- type ComInitDbPacket
- type ComPingPacket
- type ComStmtCloseAndPrepare
- type ComStmtClosePacket
- type ComStmtExecute
- type ComStmtFetchPacket
- type ComStmtPreparePacket
- type ComStmtPreparePacket1
- type EOFPacket
- type ERRPacket
- type HandshakeResponse
- type HandshakeResponseOk
- type HandshakeV10Packet
- type MySQLPacket
- type MySQLPacketHeader
- type MySqlParser
- type NextAuthPacket
- type OKPacket
- type PacketHeader
- type PacketType2
- type PasswordData
- type PluginDetails
- type QueryPacket
- type ResultSet
- type Row
- type RowColumnDefinition
- type RowDataPacket
- type RowHeader
- type StmtPrepareOk
Constants ¶
View Source
const ( CLIENT_PLUGIN_AUTH = 0x00080000 CLIENT_CONNECT_WITH_DB = 0x00000008 CLIENT_CONNECT_ATTRS = 0x00100000 CLIENT_ZSTD_COMPRESSION_ALGORITHM = 0x00010000 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthSwitchRequestPacket ¶
type AuthSwitchResponsePacket ¶
type AuthSwitchResponsePacket struct {
AuthResponseData string `yaml:"auth_response_data"`
}
type BoundParameter ¶
type COM_STMT_RESET ¶
type COM_STMT_RESET struct {
StatementID uint32 `yaml:"statement_id"`
}
type COM_STMT_SEND_LONG_DATA ¶
type CapabilityFlags ¶
type CapabilityFlags uint32
type ColumnDefinition ¶
type ColumnDefinition struct { PacketHeader PacketHeader `yaml:"packet_header"` Catalog string `yaml:"catalog"` Schema string `yaml:"schema"` Table string `yaml:"table"` OrgTable string `yaml:"org_table"` Name string `yaml:"name"` OrgName string `yaml:"org_name"` NextLength uint64 `yaml:"next_length"` CharacterSet uint16 `yaml:"character_set"` ColumnLength uint32 `yaml:"column_length"` ColumnType byte `yaml:"column_type"` Flags uint16 `yaml:"flags"` Decimals byte `yaml:"decimals"` DefaultValue string `yaml:"string"` }
type ComChangeUserPacket ¶
type ComInitDbPacket ¶
type ComPingPacket ¶
type ComPingPacket struct { }
type ComStmtCloseAndPrepare ¶
type ComStmtCloseAndPrepare struct { StmtClose ComStmtClosePacket StmtPrepare ComStmtPreparePacket1 }
type ComStmtClosePacket ¶
type ComStmtExecute ¶
type ComStmtFetchPacket ¶
type ComStmtPreparePacket ¶
type ComStmtPreparePacket struct {
Query string
}
type ComStmtPreparePacket1 ¶
type HandshakeResponse ¶
type HandshakeResponse struct { CapabilityFlags uint32 `yaml:"capability_flags"` MaxPacketSize uint32 `yaml:"max_packet_size"` CharacterSet uint8 `yaml:"character_set"` Reserved [23]byte `yaml:"reserved"` Username string `yaml:"username"` AuthData []byte `yaml:"auth_data"` Database string `yaml:"database"` AuthPluginName string `yaml:"auth_plugin_name"` ConnectAttributes map[string]string `yaml:"connect_attributes"` ZstdCompressionLevel byte `yaml:"zstdcompressionlevel"` }
type HandshakeResponseOk ¶
type HandshakeResponseOk struct { PacketIndicator string `yaml:"packet_indicator"` PluginDetails PluginDetails `yaml:"plugin_details"` RemainingBytes []byte `yaml:"remaining_bytes"` }
type HandshakeV10Packet ¶
type HandshakeV10Packet struct { ProtocolVersion uint8 `yaml:"protocol_version"` ServerVersion string `yaml:"server_version"` ConnectionID uint32 `yaml:"connection_id"` AuthPluginData []byte `yaml:"auth_plugin_data"` CapabilityFlags uint32 `yaml:"capability_flags"` CharacterSet uint8 `yaml:"character_set"` StatusFlags uint16 `yaml:"status_flags"` AuthPluginName string `yaml:"auth_plugin_name"` }
func (*HandshakeV10Packet) GetAuthMethod ¶
func (packet *HandshakeV10Packet) GetAuthMethod() string
func (*HandshakeV10Packet) ShouldUseSSL ¶
func (packet *HandshakeV10Packet) ShouldUseSSL() bool
type MySQLPacket ¶
type MySQLPacket struct { Header MySQLPacketHeader `yaml:"header"` Payload []byte `yaml:"payload"` }
func (*MySQLPacket) Encode ¶
func (p *MySQLPacket) Encode() ([]byte, error)
type MySQLPacketHeader ¶
type MySQLPacketHeader struct { PayloadLength uint32 `yaml:"payload_length"` // MySQL packet payload length SequenceID uint8 `yaml:"sequence_id"` // MySQL packet sequence ID }
func DecodeMySQLPacket ¶
func DecodeMySQLPacket(packet MySQLPacket, logger *zap.Logger, destConn net.Conn) (string, MySQLPacketHeader, interface{}, error)
type MySqlParser ¶
type MySqlParser struct {
// contains filtered or unexported fields
}
func NewMySqlParser ¶
func (*MySqlParser) OutgoingType ¶
func (sql *MySqlParser) OutgoingType(buffer []byte) bool
func (*MySqlParser) ProcessOutgoing ¶
type NextAuthPacket ¶
type NextAuthPacket struct {
PluginData byte `yaml:"plugin_data"`
}
type OKPacket ¶
type OKPacket struct { AffectedRows uint64 `json:"affected_rows,omitempty" yaml:"affected_rows"` LastInsertID uint64 `json:"last_insert_id,omitempty" yaml:"last_insert_id"` StatusFlags uint16 `json:"status_flags,omitempty" yaml:"status_flags"` Warnings uint16 `json:"warnings,omitempty" yaml:"warnings"` Info string `json:"info,omitempty" yaml:"info"` }
type PacketHeader ¶
type PacketHeader struct { PacketLength uint8 `yaml:"packet_length"` PacketSequenceID uint8 `yaml:"packet_sequence_id"` }
common
type PacketType2 ¶
type PasswordData ¶
type PluginDetails ¶
type QueryPacket ¶
type ResultSet ¶
type ResultSet struct { Columns []*ColumnDefinition `yaml:"columns"` Rows []*Row `yaml:"rows"` EOFPresent bool `yaml:"eofPresent"` PaddingPresent bool `yaml:"paddingPresent"` EOFPresentFinal bool `yaml:"eofPresentFinal"` PaddingPresentFinal bool `yaml:"paddingPresentFinal"` OptionalPadding bool `yaml:"optionalPadding"` OptionalEOFBytes []byte `yaml:"optionalEOFBytes"` EOFAfterColumns []byte `yaml:"eofAfterColumns"` }
type Row ¶
type Row struct { Header RowHeader `yaml:"header"` Columns []RowColumnDefinition `yaml:"row_column_definition"` }
type RowColumnDefinition ¶
type RowDataPacket ¶
type RowDataPacket struct {
Data []byte `yaml:"data"`
}
type StmtPrepareOk ¶
type StmtPrepareOk struct { Status byte `yaml:"status"` StatementID uint32 `yaml:"statement_id"` NumColumns uint16 `yaml:"num_columns"` NumParams uint16 `yaml:"num_params"` WarningCount uint16 `yaml:"warning_count"` ColumnDefs []ColumnDefinition `yaml:"column_definitions"` ParamDefs []ColumnDefinition `yaml:"param_definitions"` }
Source Files ¶
- authMoreData.go
- authSwitchRequestPacket.go
- authSwitchResponsePacket.go
- comChangeUserPacket.go
- comFetchPacket.go
- comInitDb.go
- comPingPacket.go
- comStmtCloseMoreData.go
- comStmtClosePacket.go
- comStmtPrepareOk.go
- comStmtPreparePacket.go
- comStmtResetPacket.go
- comStmtSendLongDataPacket.go
- encryptPassword.go
- eofPacket.go
- errPacket.go
- executePacket.go
- handshakeResponseOkPacket.go
- handshakeResponsePacket.go
- handshakeV10Packet.go
- mysqlparser.go
- okPacket.go
- operation.go
- queryPacket.go
- resultsetPacket.go
- type2Packet.go
Click to show internal directories.
Click to hide internal directories.