mysql

package
v0.0.0-...-7a53ea4 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COM_SLEEP byte = iota
	COM_QUIT
	COM_INIT_DB
	COM_QUERY
	COM_FIELD_LIST
	COM_CREATE_DB
	COM_DROP_DB
	COM_REFRESH
	COM_SHUTDOWN
	COM_STATISTICS
	COM_PROCESS_INFO
	COM_CONNECT
	COM_PROCESS_KILL
	COM_DEBUG
	COM_PING
	COM_TIME
	COM_DELAYED_INSERT
	COM_CHANGE_USER
	COM_BINLOG_DUMP
	COM_TABLE_DUMP
	COM_CONNECT_OUT
	COM_REGISTER_SLAVE
	COM_STMT_EXECUTE
	COM_STMT_SEND_LONG_DATA
	COM_STMT_CLOSE
	COM_STMT_RESET
	COM_SET_OPTION
	COM_STMT_FETCH
	COM_DAEMON
	COM_BINLOG_DUMP_GTID
	COM_RESET_CONNECTION
)

https://dev.mysql.com/doc/internals/en/text-protocol.html

View Source
const COL_DEF_FIRST_PAYLOAD_BYTE uint8 = 0x03
View Source
const EOF uint8 = 0xFE
View Source
const ERR uint8 = 0xFF
View Source
const OK uint8 = 0x00

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Port uint16 `long:"port" description:"MySQL port" default:"3306"`
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser implements sniffer.Consumer

func (*Parser) On

func (p *Parser) On(ms sniffer.MessageStream)

func (*Parser) QueryEventDone

func (p *Parser) QueryEventDone()

type ParserFactory

type ParserFactory struct {
	Options Options
}

ParserFactory implements sniffer.ConsumerFactory TODO: this way of setting things up is kind of confusing

func (*ParserFactory) BPFFilter

func (pf *ParserFactory) BPFFilter() string

func (*ParserFactory) New

type QueryEvent

type QueryEvent struct {
	Timestamp   time.Time
	ClientIP    string
	ServerIP    string
	QueryTime   float64
	Query       string
	RowsSent    int
	BytesSent   int
	ColumnsSent int
	Error       bool
	ErrorCode   int
}

Jump to

Keyboard shortcuts

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