package
0.0.0-20240917120716-8843776e9f3a
Repository: https://github.com/cossacklabs/acra.git
Documentation: pkg.go.dev

# Packages

# Functions

FetchQueryFromParse return Query value from Parse packet payload (without message type and length of packet) Find first null terminator as end of prepared statement name and find next which terminate query string Parse packet has next structure: 'P' + int32 (length of packet) + NullTerminatedString (prepared statement name) + + NullTerminatedString (query) + int16 (number of next int32 parameters) + int32[n] (parameters) https://www.postgresql.org/docs/9.3/protocol-message-formats.html.
GetParameterFormatByIndex return parameter format according to PostgreSQL rules.
NewBindPacket parses Bind packet from data.
NewClientSidePacketHandler return new PacketHandler with initialized own logger for client's packets.
NewDataTypeFormat create new DataTypeFormat from ColumnInfo and ColumnEncryptionSetting.
NewDbSidePacketHandler return new PacketHandler with initialized own logger for databases's packets.
NewEncryptionSettingExtractor returns new initialized EncryptionSettingExtractor.
NewExecutePacket parses Execute packet from data.
NewParsePacket parse data and return as ParsePacket or error.
NewPgBoundValue makes a pgsql BoundValue from copied input data.
NewPgError returns packed error.
NewPgProtocolState makes an initial PostgreSQL state, awaiting for queries.
NewPgProxy returns new PgProxy.
NewPgSQLDataDecoderProcessor return new data decoder from text/binary format from database side.
NewPgSQLDataEncoderProcessor return new data encoder to text/binary format.
NewPortal makes a new portal.
NewPostgresqlPreparedStatementsQuery create new QueryDataEncryptor to handle SQL PreparedStatement in the following format `prepare {prepare_statement_name} (params...) as the sql-query` and `execute (values...) {prepare_statement_name}`.
NewPreparedStatement makes a new prepared statement.
NewPreparedStatementRegistry makes a new empty prepared statement registry.
NewProxyFactory return new proxyFactory.

# Constants

PgSQL constant sizes and types.
Possible PacketType values.
PgSQL constant sizes and types.
Possible PacketType values.
PgSQL constant sizes and types.
PgSQL constant sizes and types.
Possible PacketType values.
DataRowLengthBufSize each postgresql packet contain 4 byte that store length of message contents in bytes, including self.
https://www.postgresql.org/docs/9.4/static/protocol-message-formats.html.
PgSQL constant sizes and types.
PgSQL constant sizes and types.
PgSQL constant sizes and types.
Possible PacketType values.
PgSQL constant sizes and types.
NullColumnValue indicates that column has null value without any data https://www.postgresql.org/docs/9.3/static/protocol-message-formats.html.
Possible PacketType values.
random chosen.
Possible PacketType values.
PgSQL constant sizes and types.
PgSQL constant sizes and types.
Possible PacketType values.
PgSQL constant sizes and types.
Possible PacketType values.
PgSQL constant sizes and types.
PgSQL constant sizes and types.
PgSQL constant sizes and types.
Possible PacketType values.
Possible PacketType values.
PgSQL constant sizes and types.
Possible PacketType values.
WithoutMessageType used to indicate that MessageType wasn't set and shouldn't marshaled.

# Variables

Constant values of specific postgresql messages - https://www.postgresql.org/docs/current/static/protocol-message-formats.html.
Length is always 16 plus CancelRequest.
ErrArrayTooBig signals that an array it too big to fit into a packet.
Errors returned by prepared statement registry.
Errors returned when initializing session registries.
Errors returned when initializing session registries.
Errors returned when initializing session registries.
ErrNilPendingPacket error when took nil instead of pending packet.
ErrNotEnoughFormats is returned when Bind packet is malformed and does not contain enough formats for values.
ErrPacketTruncated signals that the packet is too short and cannot be parsed.
ErrRemoveFromEmptyPendingList error after trying to remove object from empty list.
ErrStatementAlreadyInRegistry represent an error that prepared statement already exist in session registry.
Errors returned by prepared statement registry.
ErrStatementAlreadyInRegistry represent an error that prepared statement already exist in session registry.
ErrTerminatorNotFound not found terminator for string value.
ErrUnknownFormat is returned when Bind packet contains a value format that we don't recognize.
ErrUnsupportedPacketType error when recognized unsupported message type or new added to postgresql wire protocol.
ErrUnsupportedPendingPacketType error after using unknown type of structure.
Constant values of specific postgresql messages - https://www.postgresql.org/docs/current/static/protocol-message-formats.html.
Length is always 8 plus GSSENCRequest.
ReadyForQuery - 'Z' ReadyForQuery, 0 0 0 5 length, 'I' idle status https://www.postgresql.org/docs/9.3/static/protocol-message-formats.html.
Constant values of specific postgresql messages - https://www.postgresql.org/docs/current/static/protocol-message-formats.html.
Length is always 8 plus SSLRequest.
Constant values of specific postgresql messages - https://www.postgresql.org/docs/current/static/protocol-message-formats.html.
TerminatePacket sent by client to close connection with db https://www.postgresql.org/docs/9.4/static/protocol-message-formats.html.

# Structs

BindPacket represents "Bind" packet of the PostgreSQL protocol, containing bound parameters of a prepared statement.
ColumnData hold column length and data.
DataTypeFormat implementation of type_awareness.DataTypeFormat for PostgreSQL.
EncryptionSettingExtractor uses QueryDataEncryptor to extract ColumnEncryptionSetting for every column in the result.
ExecutePacket represents "Execute" packet of the PostgreSQL protocol, containing the name of the portal to query for data.
PacketHandler hold state of postgresql packet and process data rows every postgresql packet (except first packet Startup/SSLRequest) has struct as like MessageType[1] + PacketLength[4] + PacketData[N] where numbers are size in bytes and N depends from value in PacketLength.
ParsePacket store data related with Parse postgresql message.
PgPortal is a PostgreSQL Cursor.
PgPreparedStatement is a PostgreSQL PreparedStatement.
PgPreparedStatementRegistry is a PostgreSQL PreparedStatementRegistry.
PgProtocolState keeps track of PostgreSQL protocol state.
PgProxy represents PgSQL database connection between client and database with TLS support.
PgSQLDataDecoderProcessor implements processor and decode binary/text values from DB.
PgSQLDataEncoderProcessor implements processor and encode binary/text values before sending to app.
PreparedStatementsQuery QueryDataEncryptor process PostgreSQL SQL PreparedStatement.

# Interfaces

Cursor is used to iterate over a prepared statement.
PreparedStatement is a prepared statement, ready to be executed.

# Type aliases

PacketType describes how to handle a message packet.