package pgproto3

Import Path
	github.com/jackc/pgproto3/v2 (on go.dev)

Dependency Relation
	imports 10 packages, and imported by 2 packages


Package-Level Type Names (total 55, in which 53 are exported)
/* sort exporteds by: | */
AuthenticationCleartextPassword is a message sent from the backend indicating that a clear-text password is required. Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. *T : BackendMessage *T : Message
AuthenticationMD5Password is a message sent from the backend indicating that an MD5 hashed password is required. Salt [4]byte Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. *T : BackendMessage *T : Message
AuthenticationOk is a message sent from the backend indicating that authentication was successful. Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. *T : BackendMessage *T : Message
AuthenticationSASL is a message sent from the backend indicating that SASL authentication is required. AuthMechanisms []string Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. *T : BackendMessage *T : Message
AuthenticationSASLContinue is a message sent from the backend containing a SASL challenge. Data []byte Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. *T : BackendMessage *T : Message
AuthenticationSASLFinal is a message sent from the backend indicating a SASL authentication has completed. Data []byte Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. *T : BackendMessage *T : Message
Backend acts as a server for the PostgreSQL wire protocol version 3. Receive receives a message from the frontend. The returned message is only valid until the next call to Receive. ReceiveStartupMessage receives the initial connection message. This method is used of the normal Receive method because the initial connection message is "special" and does not include the message type as the first byte. This will return either a StartupMessage, SSLRequest, GSSEncRequest, or CancelRequest. Send sends a message to the frontend. func NewBackend(cr ChunkReader, w io.Writer) *Backend
ProcessID uint32 SecretKey uint32 Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
// no-op method to distinguish frontend from backend methods Decode is allowed and expected to retain a reference to data after returning (unlike encoding.BinaryUnmarshaler). Encode appends itself to dst and returns the new buffer. *AuthenticationCleartextPassword *AuthenticationMD5Password *AuthenticationOk *AuthenticationSASL *AuthenticationSASLContinue *AuthenticationSASLFinal *BackendKeyData *BindComplete *CloseComplete *CommandComplete *CopyBothResponse *CopyData *CopyDone *CopyInResponse *CopyOutResponse *DataRow *EmptyQueryResponse *ErrorResponse *FunctionCallResponse *NoData *NoticeResponse *NotificationResponse *ParameterDescription *ParameterStatus *ParseComplete *PortalSuspended *ReadyForQuery *RowDescription T : Message func (*Frontend).Receive() (BackendMessage, error) func github.com/jackc/pgconn.Frontend.Receive() (BackendMessage, error) func github.com/jackc/pgconn.(*PgConn).ReceiveMessage(ctx context.Context) (BackendMessage, error) func (*Backend).Send(msg BackendMessage) error
( T) Int16(n int16) []byte ( T) Int32(n int32) []byte ( T) Int64(n int64) []byte ( T) Uint16(n uint16) []byte ( T) Uint32(n uint32) []byte
DestinationPortal string ParameterFormatCodes []int16 Parameters [][]byte PreparedStatement string ResultFormatCodes []int16 Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
ProcessID uint32 SecretKey uint32 (*T) Decode(src []byte) error Encode encodes src into dst. dst will include the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
ChunkReader is an interface to decouple github.com/jackc/chunkreader from this package. Next returns buf filled with the next n bytes. If an error (including a partial read) occurs, buf must be nil. Next must preserve any partially read data. Next must not reuse buf. *github.com/jackc/chunkreader/v2.ChunkReader func NewChunkReader(r io.Reader) ChunkReader func NewBackend(cr ChunkReader, w io.Writer) *Backend func NewFrontend(cr ChunkReader, w io.Writer) *Frontend
Name string // 'S' = prepared statement, 'P' = portal Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
CommandTag []byte Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
ColumnFormatCodes []uint16 OverallFormat byte Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
Data []byte Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Message string Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
ColumnFormatCodes []uint16 OverallFormat byte Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
ColumnFormatCodes []uint16 OverallFormat byte (*T) Backend() Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
Values [][]byte Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
Name string // 'S' = prepared statement, 'P' = portal Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
Code string ColumnName string ConstraintName string DataTypeName string Detail string File string Hint string InternalPosition int32 InternalQuery string Line int32 Message string Position int32 Routine string SchemaName string Severity string TableName string UnknownFields map[byte]string Where string Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. *T : BackendMessage *T : Message func github.com/jackc/pgconn.ErrorResponseToPgError(msg *ErrorResponse) *pgconn.PgError
MaxRows uint32 Portal string Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
DataTypeOID uint32 DataTypeSize int16 Format int16 Name []byte TableAttributeNumber uint16 TableOID uint32 TypeModifier int32 MarshalJSON implements encoding/json.Marshaler. T : encoding/json.Marshaler func github.com/jackc/pgconn.(*ResultReader).FieldDescriptions() []FieldDescription func github.com/jackc/pgx/v4.QueryFuncRow.FieldDescriptions() []FieldDescription func github.com/jackc/pgx/v4.Rows.FieldDescriptions() []FieldDescription func github.com/jackc/pgx/v4.ScanRow(connInfo *pgtype.ConnInfo, fieldDescriptions []FieldDescription, values [][]byte, dest ...interface{}) error
Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Frontend acts as a client for the PostgreSQL wire protocol version 3. Receive receives a message from the backend. The returned message is only valid until the next call to Receive. Send sends a message to the backend. *T : github.com/jackc/pgconn.Frontend func NewFrontend(cr ChunkReader, w io.Writer) *Frontend
Decode is allowed and expected to retain a reference to data after returning (unlike encoding.BinaryUnmarshaler). Encode appends itself to dst and returns the new buffer. // no-op method to distinguish frontend from backend methods *Bind *CancelRequest *Close *CopyData *CopyDone *CopyFail *Describe *Execute *Flush *GSSEncRequest *Parse *PasswordMessage *Query *SASLInitialResponse *SASLResponse *SSLRequest *StartupMessage *Sync *Terminate T : Message func (*Backend).Receive() (FrontendMessage, error) func (*Backend).ReceiveStartupMessage() (FrontendMessage, error) func (*Frontend).Send(msg FrontendMessage) error
Result []byte Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
(*T) Decode(src []byte) error Encode encodes src into dst. dst will include the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Message is the interface implemented by an object that can decode and encode a particular PostgreSQL message. Decode is allowed and expected to retain a reference to data after returning (unlike encoding.BinaryUnmarshaler). Encode appends itself to dst and returns the new buffer. *AuthenticationCleartextPassword *AuthenticationMD5Password *AuthenticationOk *AuthenticationSASL *AuthenticationSASLContinue *AuthenticationSASLFinal *BackendKeyData BackendMessage (interface) *Bind *BindComplete *CancelRequest *Close *CloseComplete *CommandComplete *CopyBothResponse *CopyData *CopyDone *CopyFail *CopyInResponse *CopyOutResponse *DataRow *Describe *EmptyQueryResponse *ErrorResponse *Execute *Flush FrontendMessage (interface) *FunctionCallResponse *GSSEncRequest *NoData *NoticeResponse *NotificationResponse *ParameterDescription *ParameterStatus *Parse *ParseComplete *PasswordMessage *PortalSuspended *Query *ReadyForQuery *RowDescription *SASLInitialResponse *SASLResponse *SSLRequest *StartupMessage *Sync *Terminate
Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
Code string ColumnName string ConstraintName string DataTypeName string Detail string File string Hint string InternalPosition int32 InternalQuery string Line int32 Message string Position int32 Routine string SchemaName string Severity string TableName string UnknownFields map[byte]string Where string Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. *T : BackendMessage *T : Message
Channel string PID uint32 Payload string Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
ParameterOIDs []uint32 Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
Name string Value string Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
Name string ParameterOIDs []uint32 Query string Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
Password string Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
String string Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
TxStatus byte Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
Fields []FieldDescription Backend identifies this message as sendable by the PostgreSQL backend. Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. MarshalJSON implements encoding/json.Marshaler. *T : BackendMessage *T : Message T : encoding/json.Marshaler
AuthMechanism string Data []byte Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Data []byte Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
(*T) Decode(src []byte) error Encode encodes src into dst. dst will include the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Parameters map[string]string ProtocolVersion uint32 Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length. Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. Frontend identifies this message as sendable by a PostgreSQL frontend. MarshalJSON implements encoding/json.Marshaler. *T : FrontendMessage *T : Message T : encoding/json.Marshaler
Package-Level Functions (total 4, in which 3 are exported)
NewBackend creates a new Backend.
NewChunkReader creates and returns a new default ChunkReader.
NewFrontend creates a new Frontend.
Package-Level Constants (total 12, in which 9 are exported)
Authentication message type constants.
Authentication message type constants.
Authentication message type constants.
Authentication message type constants.
Authentication message type constants.
Authentication message type constants.
const ProtocolVersionNumber = 196608 // 3.0