l7

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MysqlComQuery       = 3
	MysqlComStmtPrepare = 0x16
	MysqlComStmtExecute = 0x17
	MysqlComStmtClose   = 0x19
)
View Source
const (
	PostgresFrameQuery byte = 'Q'
	PostgresFrameBind  byte = 'B'
	PostgresFrameParse byte = 'P'
	PostgresFrameClose byte = 'C'
)
View Source
const (
	MongoOpMSG = 2013
)

Variables

This section is empty.

Functions

func ParseDns added in v1.19.0

func ParseDns(payload []byte) (string, string, []netaddr.IP)

func ParseHttp

func ParseHttp(payload []byte) (string, string)

func ParseMemcached

func ParseMemcached(payload []byte) (string, []string)

func ParseMongo

func ParseMongo(payload []byte) (res string)

func ParseRedis

func ParseRedis(payload []byte) (cmd string, args string)

Types

type Http2FrameHeader

type Http2FrameHeader struct {
	Type     http2.FrameType
	Flags    http2.Flags
	Length   int
	StreamId uint32
}

type Http2Parser

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

func NewHttp2Parser

func NewHttp2Parser() *Http2Parser

func (*Http2Parser) Parse

func (p *Http2Parser) Parse(method Method, payload []byte, kernelTime uint64) []Http2Request

type Http2Request

type Http2Request struct {
	Method   string
	Path     string
	Scheme   string
	Status   Status
	Duration time.Duration
	// contains filtered or unexported fields
}

type Method

type Method uint8
const (
	MethodUnknown           Method = 0
	MethodProduce           Method = 1
	MethodConsume           Method = 2
	MethodStatementPrepare  Method = 3
	MethodStatementClose    Method = 4
	MethodHttp2ClientFrames Method = 5
	MethodHttp2ServerFrames Method = 6
)

func (Method) String

func (m Method) String() string

type MysqlParser

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

func NewMysqlParser

func NewMysqlParser() *MysqlParser

func (*MysqlParser) Parse

func (p *MysqlParser) Parse(payload []byte, statementId uint32) string

type PostgresParser

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

func NewPostgresParser

func NewPostgresParser() *PostgresParser

func (*PostgresParser) Parse

func (p *PostgresParser) Parse(payload []byte) string

type Protocol

type Protocol uint8
const (
	ProtocolHTTP      Protocol = 1
	ProtocolPostgres  Protocol = 2
	ProtocolRedis     Protocol = 3
	ProtocolMemcached Protocol = 4
	ProtocolMysql     Protocol = 5
	ProtocolMongo     Protocol = 6
	ProtocolKafka     Protocol = 7
	ProtocolCassandra Protocol = 8
	ProtocolRabbitmq  Protocol = 9
	ProtocolNats      Protocol = 10
	ProtocolHTTP2     Protocol = 11
	ProtocolDubbo2    Protocol = 12
	ProtocolDNS       Protocol = 13
)

func (Protocol) String

func (p Protocol) String() string

type RequestData

type RequestData struct {
	Protocol    Protocol
	Status      Status
	Duration    time.Duration
	Method      Method
	StatementId uint32
	Payload     []byte
}

type Status

type Status int
const (
	StatusUnknown Status = 0
	StatusOk      Status = 200
	StatusFailed  Status = 500
)

func (Status) DNS added in v1.19.0

func (s Status) DNS() string

func (Status) Error

func (s Status) Error() bool

func (Status) Http

func (s Status) Http() string

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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