parser

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectionClientToServer = proxy.DirectionClientToServer
	DirectionServerToClient = proxy.DirectionServerToClient
	RiskLevelCritical       = proxy.RiskLevelCritical
	RiskLevelHigh           = proxy.RiskLevelHigh
	RiskLevelMedium         = proxy.RiskLevelMedium
	RiskLevelLow            = proxy.RiskLevelLow
	RiskLevelNone           = proxy.RiskLevelNone
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DangerousPattern

type DangerousPattern struct {
	Pattern     *regexp.Regexp
	Level       RiskLevel
	Description string
}

DangerousPattern 危险 SQL 模式

type Direction

type Direction = proxy.Direction

从 proxy 包导入公共类型

type MySQLParser

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

MySQLParser MySQL 协议解析器

func NewMySQLParser

func NewMySQLParser() *MySQLParser

NewMySQLParser 创建 MySQL 解析器

func (*MySQLParser) DetectRisk

func (p *MySQLParser) DetectRisk(event *audit.OperationEvent) RiskLevel

DetectRisk 检测 SQL 风险

func (*MySQLParser) GetBufferSize

func (p *MySQLParser) GetBufferSize() int

GetBufferSize 获取缓冲区大小

func (*MySQLParser) Parse

func (p *MySQLParser) Parse(ctx context.Context, data []byte, direction Direction, sessionID string) (*ParseResult, error)

Parse 解析 MySQL 数据包

func (*MySQLParser) Reset

func (p *MySQLParser) Reset()

Reset 重置解析器状态

func (*MySQLParser) ShouldBlock

func (p *MySQLParser) ShouldBlock(event *audit.OperationEvent) bool

ShouldBlock 判断是否需要阻断

type ParseResult

type ParseResult = proxy.ParseResult

type RiskLevel

type RiskLevel = proxy.RiskLevel

Jump to

Keyboard shortcuts

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