v1

package
v2.3.0-beta35 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package v1 provides functionality for decoding Postgres requests and responses.

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
)

constants for the authentication message types

View Source
const ProtocolVersionNumber uint32 = 196608

ProtocolVersionNumber Replace with actual version number if different

Variables

This section is empty.

Functions

func IsValuePresent

func IsValuePresent(connectionid string, value string) bool

func LaevensteinDistance

func LaevensteinDistance(str1, str2 string) bool

func NewPostgresV1

func NewPostgresV1(logger *zap.Logger) integrations.Integrations

func PreparedStatementMatch

func PreparedStatementMatch(mock *models.Mock, actualPgReq *models.Backend, logger *zap.Logger, ConnectionID string, recordedPrep PrepMap) (bool, []string, error)

Types

type BackendWrapper

type BackendWrapper struct {
	BackendWrapper models.Backend
}

func NewBackend

func NewBackend() *BackendWrapper

type FrontendWrapper

type FrontendWrapper struct {
	FrontendWrapper models.Frontend
}

func NewFrontend

func NewFrontend() *FrontendWrapper

type PostgresV1

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

func (*PostgresV1) MatchType

func (p *PostgresV1) MatchType(_ context.Context, reqBuf []byte) bool

MatchType determines if the outgoing network call is Postgres by comparing the message format with that of a Postgres text message.

func (*PostgresV1) MockOutgoing

func (p *PostgresV1) MockOutgoing(ctx context.Context, src net.Conn, dstCfg *models.ConditionalDstCfg, mockDb integrations.MockMemDb, opts models.OutgoingOptions) error

func (*PostgresV1) RecordOutgoing

func (p *PostgresV1) RecordOutgoing(ctx context.Context, src net.Conn, dst net.Conn, mocks chan<- *models.Mock, opts models.OutgoingOptions) error

type PrepMap

type PrepMap map[string][]QueryData

type QueryData

type QueryData struct {
	PrepIdentifier string `json:"PrepIdentifier" yaml:"PrepIdentifier"`
	Query          string `json:"Query" yaml:"Query"`
}

type TestPrepMap

type TestPrepMap map[string][]QueryData

Jump to

Keyboard shortcuts

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