postgres

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MinPgSQLMessageLength = 5

Variables

View Source
var PostgreSQLFrontEndMessageTypes = []uint8{
	'B',
	'C',
	'D',
	'E',
	'F',
	'f',
	'd',
	'c',
	'H',
	'P',
	'p',
	'Q',
	'S',
	'X',
}

Functions

func BuildAuthCleartextChallenge added in v0.4.4

func BuildAuthCleartextChallenge() ([]byte, error)

BuildAuthCleartextChallenge builds an AuthenticationCleartextPassword message.

func BuildAuthMD5Challenge added in v0.4.4

func BuildAuthMD5Challenge(salt [4]byte) ([]byte, error)

BuildAuthMD5Challenge builds an AuthenticationMD5Password message with the given salt.

func BuildAuthOk added in v0.4.4

func BuildAuthOk(serverVersion string, processID uint32, secretKey uint32) ([]byte, error)

BuildAuthOk builds the full post-authentication response sequence: AuthenticationOk + ParameterStatus(server_version) + ParameterStatus(client_encoding) + BackendKeyData + ReadyForQuery.

func BuildAuthSASLChallenge added in v0.4.4

func BuildAuthSASLChallenge(mechanisms []string) ([]byte, error)

BuildAuthSASLChallenge builds an AuthenticationSASL message listing the given mechanisms.

func BuildAuthSASLContinue added in v0.4.4

func BuildAuthSASLContinue(data []byte) ([]byte, error)

BuildAuthSASLContinue builds an AuthenticationSASLContinue message with server-first data.

func BuildAuthSASLFinal added in v0.4.4

func BuildAuthSASLFinal(data []byte) ([]byte, error)

BuildAuthSASLFinal builds an AuthenticationSASLFinal message with server-final data.

func BuildTerminateWithError added in v0.4.4

func BuildTerminateWithError(msg, severity, code, detail string) ([]byte, error)

BuildTerminateWithError builds a Terminate message prepended with an ErrorResponse.

func DecodeBytes

func DecodeBytes(encoded string) []byte

DecodeBytes decodes a base64 encoded string to bytes.

func ErrorResponse added in v0.1.4

func ErrorResponse(msg, severity, code, detail string) []byte

func GetQueryFromRequest added in v0.0.18

func GetQueryFromRequest(req interface{}) (string, error)

GetQueryFromRequest decodes the request and returns the query.

func GetTablesFromQuery added in v0.0.18

func GetTablesFromQuery(query string) ([]string, error)

GetTablesFromQuery returns the tables used in a query.

func HandleClientMessage

func HandleClientMessage(req *v1.Struct, logger hclog.Logger) (*v1.Struct, error)

HandleClientMessage handles the client message. This function should be called from onTrafficFromClient hook.

func HandleServerMessage

func HandleServerMessage(resp *v1.Struct, logger hclog.Logger) (*v1.Struct, error)

HandleServerMessage handles the server response. This function should be called from onTrafficFromServer hook.

func IsPostgresSSLRequest added in v0.1.3

func IsPostgresSSLRequest(b []byte) bool

IsPostgresSSLRequest returns true if the message is a SSL request.

func IsPostgresStartupMessage

func IsPostgresStartupMessage(b []byte) bool

IsPostgresStartupMessage returns true if the message is a startup message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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