mysql

package
v0.0.0-...-59efaf5 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTooLongPayload = errors.New("too long payload")
	ErrNotMySQLPacket = errors.New("not mysql packet")
)

Functions

This section is empty.

Types

type Header struct {
	PayloadLength int
	SequenceID    uint8
}

type MySQLMatcher

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

func NewMySQLMatcher

func NewMySQLMatcher() *MySQLMatcher

func (*MySQLMatcher) MatchRequest

func (m *MySQLMatcher) MatchRequest(req *protocols.Request) *perisco.ProtoMessage

MatchRequest implements protocols.ProtoMatcher.

func (*MySQLMatcher) MatchResponse

func (m *MySQLMatcher) MatchResponse(resp *protocols.Response) *perisco.ProtoMessage

MatchResponse implements protocols.ProtoMatcher.

type MySQLParser

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

MySQLParser should avoid false positives

MySQL packet:

0         8        16        24        32
+---------+---------+---------+---------+
|        payload_length       | seq_id  |
+---------+---------+---------+---------+
|                                       |
.            ...  body ...              .
.                                       .
.                                       .
+----------------------------------------

func NewMySQLParser

func NewMySQLParser() *MySQLParser

func (*MySQLParser) EnableInferRequest

func (p *MySQLParser) EnableInferRequest() bool

func (*MySQLParser) EnableInferResponse

func (p *MySQLParser) EnableInferResponse() bool

func (*MySQLParser) ParseRequest

func (p *MySQLParser) ParseRequest(sockKey *types.SockKey, msg []byte) ([]protocols.ProtoRequest, error)

ParseRequest implements protocols.ProtoParser.

func (*MySQLParser) ParseResponse

func (p *MySQLParser) ParseResponse(sockKey *types.SockKey, msg []byte) ([]protocols.ProtoResponse, error)

ParseResponse implements protocols.ProtoParser.

func (*MySQLParser) ProtoType

func (*MySQLParser) ProtoType() types.ProtocolType

ProtoType implements protocols.ProtoParser.

type MySQLRequest

type MySQLRequest struct {
	PayloadLength int
	Command       pb.MySQLCommand
}

func (*MySQLRequest) ProtoType

func (*MySQLRequest) ProtoType() types.ProtocolType

ProtoType implements ProtoRequest

func (*MySQLRequest) Protobuf

func (r *MySQLRequest) Protobuf() *pb.Request

Protobuf implements ProtoRequest

type MySQLResponse

type MySQLResponse struct {
	Type         pb.MySQLResponseType
	AffectedRows uint64
	ErrorCode    uint16
}

func (*MySQLResponse) ProtoType

func (*MySQLResponse) ProtoType() types.ProtocolType

ProtoType implements ProtoResponse

func (*MySQLResponse) Protobuf

func (r *MySQLResponse) Protobuf() *pb.Response

Protobuf implements ProtoResponse

Jump to

Keyboard shortcuts

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