Documentation ¶
Overview ¶
Package mysql provides integration with MySQL outgoing.
Index ¶
- Constants
- func NewMySQL(logger *zap.Logger) integrations.Integrations
- 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 CustomPacket
- type CustomPacketHeader
- type EOFPacket
- type ERRPacket
- type HandshakeResponse
- type HandshakeResponseOk
- type HandshakeV10Packet
- type MySQL
- 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 )
constants for capability flags
Variables ¶
This section is empty.
Functions ¶
func NewMySQL ¶
func NewMySQL(logger *zap.Logger) integrations.Integrations
Types ¶
type AuthSwitchRequestPacket ¶
type AuthSwitchResponsePacket ¶
type AuthSwitchResponsePacket struct {
AuthResponseData string `json:"auth_response_data,omitempty" yaml:"auth_response_data,omitempty"`
}
type BoundParameter ¶
type COM_STMT_RESET ¶
type COM_STMT_RESET struct {
StatementID uint32 `json:"statement_id,omitempty" yaml:"statement_id,omitempty,flow"`
}
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 ComChangeUserPacket struct { User string `json:"user,omitempty" yaml:"user,omitempty,flow"` Auth string `json:"auth,omitempty" yaml:"auth,omitempty,flow"` Db string `json:"db,omitempty" yaml:"db,omitempty,flow"` CharacterSet uint8 `json:"character_set,omitempty" yaml:"character_set,omitempty,flow"` AuthPlugin string `json:"auth_plugin,omitempty" yaml:"auth_plugin,omitempty,flow"` }
type ComInitDbPacket ¶
type ComPingPacket ¶
type ComPingPacket struct { }
type ComStmtCloseAndPrepare ¶
type ComStmtCloseAndPrepare struct { StmtClose ComStmtClosePacket `json:"stmt_close,omitempty" yaml:"stmt_close,omitempty"` StmtPrepare ComStmtPreparePacket1 `json:"stmt_prepare,omitempty" yaml:"stmt_prepare,omitempty"` }
type ComStmtClosePacket ¶
type ComStmtExecute ¶
type ComStmtExecute struct { StatementID uint32 `json:"statement_id,omitempty" yaml:"statement_id,omitempty,flow"` Flags byte `json:"flags,omitempty" yaml:"flags,omitempty,flow"` IterationCount uint32 `json:"iteration_count,omitempty" yaml:"iteration_count,omitempty,flow"` NullBitmap string `json:"null_bitmap,omitempty" yaml:"null_bitmap,omitempty,flow"` ParamCount uint16 `json:"param_count,omitempty" yaml:"param_count,omitempty,flow"` Parameters []BoundParameter `json:"parameters,omitempty" yaml:"parameters,omitempty,flow"` }
type ComStmtFetchPacket ¶
type ComStmtPreparePacket ¶
type ComStmtPreparePacket struct {
Query string `json:"query,omitempty" yaml:"query,omitempty,flow"`
}
type ComStmtPreparePacket1 ¶
type CustomPacket ¶
type CustomPacket struct { Header CustomPacketHeader `yaml:"header"` Payload []byte `yaml:"payload"` }
func (*CustomPacket) Encode ¶
func (p *CustomPacket) Encode() ([]byte, error)
type CustomPacketHeader ¶
type CustomPacketHeader struct { PayloadLength uint32 `yaml:"payload_length"` // MySQL packet payload length SequenceID uint8 `yaml:"sequence_id"` // MySQL packet sequence ID }
func DecodeMySQLPacket ¶
func DecodeMySQLPacket(logger *zap.Logger, packet CustomPacket) (string, CustomPacketHeader, interface{}, error)
type ERRPacket ¶
type ERRPacket struct { Header byte `json:"header,omitempty" yaml:"header,omitempty,flow"` ErrorCode uint16 `json:"error_code,omitempty" yaml:"error_code,omitempty,flow"` SQLStateMarker string `json:"sql_state_marker,omitempty" yaml:"sql_state_marker,omitempty,flow"` SQLState string `json:"sql_state,omitempty" yaml:"sql_state,omitempty,flow"` ErrorMessage string `json:"error_message,omitempty" yaml:"error_message,omitempty,flow"` }
type HandshakeResponse ¶
type HandshakeResponse struct { CapabilityFlags uint32 `json:"capability_flags,omitempty" yaml:"capability_flags,omitempty,flow"` MaxPacketSize uint32 `json:"max_packet_size,omitempty" yaml:"max_packet_size,omitempty,flow"` CharacterSet uint8 `json:"character_set,omitempty" yaml:"character_set,omitempty,flow"` Reserved int `json:"reserved,omitempty" yaml:"reserved,omitempty,flow"` Username string `json:"username,omitempty" yaml:"username,omitempty,flow"` AuthData string `json:"auth_data,omitempty" yaml:"auth_data,omitempty,flow"` Database string `json:"database,omitempty" yaml:"database,omitempty,flow"` AuthPluginName string `json:"auth_plugin_name,omitempty" yaml:"auth_plugin_name,omitempty,flow"` ConnectAttributes map[string]string `json:"connect_attributes,omitempty" yaml:"connect_attributes,omitempty,flow"` ZstdCompressionLevel byte `json:"zstdcompressionlevel,omitempty" yaml:"zstdcompressionlevel,omitempty,flow"` }
type HandshakeResponseOk ¶
type HandshakeResponseOk struct { PacketIndicator string `json:"packet_indicator,omitempty" yaml:"packet_indicator,omitempty,flow"` PluginDetails PluginDetails `json:"plugin_details,omitempty" yaml:"plugin_details,omitempty,flow"` RemainingBytes string `json:"remaining_bytes,omitempty" yaml:"remaining_bytes,omitempty,flow"` }
type HandshakeV10Packet ¶
type HandshakeV10Packet struct { ProtocolVersion uint8 `json:"protocol_version,omitempty" yaml:"protocol_version,omitempty,flow"` ServerVersion string `json:"server_version,omitempty" yaml:"server_version,omitempty,flow"` ConnectionID uint32 `json:"connection_id,omitempty" yaml:"connection_id,omitempty,flow"` AuthPluginData string `json:"auth_plugin_data,omitempty" yaml:"auth_plugin_data,omitempty,flow"` CapabilityFlags uint32 `json:"capability_flags,omitempty" yaml:"capability_flags,omitempty,flow"` CharacterSet uint8 `json:"character_set,omitempty" yaml:"character_set,omitempty,flow"` StatusFlags uint16 `json:"status_flags,omitempty" yaml:"status_flags,omitempty,flow"` AuthPluginName string `json:"auth_plugin_name,omitempty" yaml:"auth_plugin_name,omitempty,flow"` }
func (*HandshakeV10Packet) GetAuthMethod ¶
func (packet *HandshakeV10Packet) GetAuthMethod() string
func (*HandshakeV10Packet) ShouldUseSSL ¶
func (packet *HandshakeV10Packet) ShouldUseSSL() bool
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
func (*MySQL) MockOutgoing ¶
func (m *MySQL) MockOutgoing(ctx context.Context, src net.Conn, dstCfg *integrations.ConditionalDstCfg, mockDb integrations.MockMemDb, opts models.OutgoingOptions) error
type NextAuthPacket ¶
type NextAuthPacket struct {
PluginData byte `json:"plugin_data,omitempty" yaml:"plugin_data,omitempty"`
}
type OKPacket ¶
type OKPacket struct { AffectedRows uint64 `json:"affected_rows,omitempty" yaml:"affected_rows,omitempty,flow"` LastInsertID uint64 `json:"last_insert_id,omitempty" yaml:"last_insert_id,omitempty,flow"` StatusFlags uint16 `json:"status_flags,omitempty" yaml:"status_flags,omitempty,flow"` Warnings uint16 `json:"warnings,omitempty" yaml:"warnings,omitempty,flow"` Info string `json:"info,omitempty" yaml:"info,omitempty,flow"` }
type PacketHeader ¶
type PacketType2 ¶
type PasswordData ¶
type PluginDetails ¶
type QueryPacket ¶
type ResultSet ¶
type ResultSet struct { Columns []*ColumnDefinition `json:"columns,omitempty" yaml:"columns,omitempty,flow"` Rows []*Row `json:"rows,omitempty" yaml:"rows,omitempty,flow"` EOFPresent bool `json:"eofPresent,omitempty" yaml:"eofPresent,omitempty,flow"` PaddingPresent bool `json:"paddingPresent,omitempty" yaml:"paddingPresent,omitempty,flow"` EOFPresentFinal bool `json:"eofPresentFinal,omitempty" yaml:"eofPresentFinal,omitempty,flow"` PaddingPresentFinal bool `json:"paddingPresentFinal,omitempty" yaml:"paddingPresentFinal,omitempty,flow"` OptionalPadding bool `json:"optionalPadding,omitempty" yaml:"optionalPadding,omitempty,flow"` OptionalEOFBytes string `json:"optionalEOFBytes,omitempty" yaml:"optionalEOFBytes,omitempty,flow"` EOFAfterColumns string `json:"eofAfterColumns,omitempty" yaml:"eofAfterColumns,omitempty,flow"` }
type Row ¶
type Row struct { Header RowHeader `json:"header,omitempty" yaml:"header,omitempty,flow"` Columns []RowColumnDefinition `json:"columns,omitempty" yaml:"row_column_definition,omitempty,flow"` }
type RowColumnDefinition ¶
type RowDataPacket ¶
type RowDataPacket struct {
Data []byte `yaml:"data"`
}
type StmtPrepareOk ¶
type StmtPrepareOk struct { Status byte `json:"status,omitempty" yaml:"status,omitempty,flow"` StatementID uint32 `json:"statement_id,omitempty" yaml:"statement_id,omitempty,flow"` NumColumns uint16 `json:"num_columns,omitempty" yaml:"num_columns,omitempty,flow"` NumParams uint16 `json:"num_params,omitempty" yaml:"num_params,omitempty,flow"` WarningCount uint16 `json:"warning_count,omitempty" yaml:"warning_count,omitempty,flow"` ColumnDefs []ColumnDefinition `json:"column_definitions,omitempty" yaml:"column_definitions,omitempty,flow"` ParamDefs []ColumnDefinition `json:"param_definitions,omitempty" yaml:"param_definitions,omitempty,flow"` }
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
- decode.go
- encode.go
- encryptPassword.go
- eofPacket.go
- errPacket.go
- executePacket.go
- handshakeResponseOkPacket.go
- handshakeResponsePacket.go
- handshakeV10Packet.go
- match.go
- mysql.go
- okPacket.go
- operation.go
- queryPacket.go
- resultsetPacket.go
- type2Packet.go
- util.go
Click to show internal directories.
Click to hide internal directories.