postgresparser

package
v2.0.0-alpha56 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

README

Integrations Package Documentation

This package includes modules that are used for parsing different protocols.

Documentation

Index

Constants

View Source
const (
	AuthTypeOk                = 0
	AuthTypeCleartextPassword = 3
	AuthTypeMD5Password       = 5
	AuthTypeSCMCreds          = 6
	AuthTypeGSS               = 7
	AuthTypeGSSCont           = 8
	AuthTypeSSPI              = 9
	AuthTypeSASL              = 10
	AuthTypeSASLContinue      = 11
	AuthTypeSASLFinal         = 12
)
View Source
const ProtocolVersionNumber uint32 = 196608 // Replace with actual version number if different

Variables

View Source
var Emoji = "\U0001F430" + " Keploy:"

Functions

func CheckValidEncode

func CheckValidEncode(tcsMocks []*models.Mock, h *hooks.Hook, log *zap.Logger)

func PostgresDecoder

func PostgresDecoder(encoded string) ([]byte, error)

func PostgresDecoderBackend

func PostgresDecoderBackend(request models.Backend) ([]byte, error)

func PostgresDecoderFrontend

func PostgresDecoderFrontend(response models.Frontend) ([]byte, error)

func PostgresEncoder

func PostgresEncoder(buffer []byte) string

func ReadBuffConn

func ReadBuffConn(conn net.Conn, bufferChannel chan []byte, errChannel chan error, logger *zap.Logger, h *hooks.Hook) error

Types

type BackendWrapper

type BackendWrapper struct {
	BackendWrapper models.Backend
}

func NewBackend

func NewBackend() *BackendWrapper

func (*BackendWrapper) DecodeStartupMessage

func (b *BackendWrapper) DecodeStartupMessage(buf []byte) (pgproto3.FrontendMessage, error)

func (*BackendWrapper) TranslateToReadableBackend

func (b *BackendWrapper) TranslateToReadableBackend(msgBody []byte) (pgproto3.FrontendMessage, error)

PG Response Packet Transcoder

type FrontendWrapper

type FrontendWrapper struct {
	FrontendWrapper models.Frontend
}

func NewFrontend

func NewFrontend() *FrontendWrapper

func (*FrontendWrapper) TranslateToReadableResponse

func (f *FrontendWrapper) TranslateToReadableResponse(msgBody []byte, logger *zap.Logger) (pgproto3.BackendMessage, error)

type PostgresParser

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

func NewPostgresParser

func NewPostgresParser(logger *zap.Logger, h *hooks.Hook) *PostgresParser

func (*PostgresParser) OutgoingType

func (p *PostgresParser) OutgoingType(buffer []byte) bool

func (*PostgresParser) ProcessOutgoing

func (p *PostgresParser) ProcessOutgoing(requestBuffer []byte, clientConn, destConn net.Conn, ctx context.Context)

Jump to

Keyboard shortcuts

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