pgx: github.com/jackc/pgx/pgproto3 Index | Files

package pgproto3

import "github.com/jackc/pgx/pgproto3"

Index

Package Files

authentication.go backend.go backend_key_data.go big_endian.go bind.go bind_complete.go close.go close_complete.go command_complete.go copy_both_response.go copy_data.go copy_done.go copy_fail.go copy_in_response.go copy_out_response.go data_row.go describe.go empty_query_response.go error_response.go execute.go flush.go frontend.go function_call_response.go no_data.go notice_response.go notification_response.go parameter_description.go parameter_status.go parse.go parse_complete.go password_message.go pgproto3.go portal_suspended.go query.go ready_for_query.go row_description.go sasl_initial_response.go sasl_response.go startup_message.go sync.go terminate.go

Constants

const (
    AuthTypeOk                = 0
    AuthTypeCleartextPassword = 3
    AuthTypeMD5Password       = 5
    AuthTypeSASL              = 10
    AuthTypeSASLContinue      = 11
    AuthTypeSASLFinal         = 12
)
const (
    TextFormat   = 0
    BinaryFormat = 1
)
const (
    ProtocolVersionNumber = 196608 // 3.0

)

type Authentication Uses

type Authentication struct {
    Type uint32

    // MD5Password fields
    Salt [4]byte

    // SASL fields
    SASLAuthMechanisms []string

    // SASLContinue and SASLFinal data
    SASLData []byte
}

func (*Authentication) Backend Uses

func (*Authentication) Backend()

func (*Authentication) Decode Uses

func (dst *Authentication) Decode(src []byte) error

func (*Authentication) Encode Uses

func (src *Authentication) Encode(dst []byte) []byte

type Backend Uses

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

func NewBackend Uses

func NewBackend(r io.Reader, w io.Writer) (*Backend, error)

func (*Backend) Receive Uses

func (b *Backend) Receive() (FrontendMessage, error)

func (*Backend) ReceiveStartupMessage Uses

func (b *Backend) ReceiveStartupMessage() (*StartupMessage, error)

func (*Backend) Send Uses

func (b *Backend) Send(msg BackendMessage) error

type BackendKeyData Uses

type BackendKeyData struct {
    ProcessID uint32
    SecretKey uint32
}

func (*BackendKeyData) Backend Uses

func (*BackendKeyData) Backend()

func (*BackendKeyData) Decode Uses

func (dst *BackendKeyData) Decode(src []byte) error

func (*BackendKeyData) Encode Uses

func (src *BackendKeyData) Encode(dst []byte) []byte

func (*BackendKeyData) MarshalJSON Uses

func (src *BackendKeyData) MarshalJSON() ([]byte, error)

type BackendMessage Uses

type BackendMessage interface {
    Message
    Backend() // no-op method to distinguish frontend from backend methods
}

type BigEndianBuf Uses

type BigEndianBuf [8]byte

func (BigEndianBuf) Int16 Uses

func (b BigEndianBuf) Int16(n int16) []byte

func (BigEndianBuf) Int32 Uses

func (b BigEndianBuf) Int32(n int32) []byte

func (BigEndianBuf) Int64 Uses

func (b BigEndianBuf) Int64(n int64) []byte

func (BigEndianBuf) Uint16 Uses

func (b BigEndianBuf) Uint16(n uint16) []byte

func (BigEndianBuf) Uint32 Uses

func (b BigEndianBuf) Uint32(n uint32) []byte

type Bind Uses

type Bind struct {
    DestinationPortal    string
    PreparedStatement    string
    ParameterFormatCodes []int16
    Parameters           [][]byte
    ResultFormatCodes    []int16
}

func (*Bind) Decode Uses

func (dst *Bind) Decode(src []byte) error

func (*Bind) Encode Uses

func (src *Bind) Encode(dst []byte) []byte

func (*Bind) Frontend Uses

func (*Bind) Frontend()

func (*Bind) MarshalJSON Uses

func (src *Bind) MarshalJSON() ([]byte, error)

type BindComplete Uses

type BindComplete struct{}

func (*BindComplete) Backend Uses

func (*BindComplete) Backend()

func (*BindComplete) Decode Uses

func (dst *BindComplete) Decode(src []byte) error

func (*BindComplete) Encode Uses

func (src *BindComplete) Encode(dst []byte) []byte

func (*BindComplete) MarshalJSON Uses

func (src *BindComplete) MarshalJSON() ([]byte, error)

type Close Uses

type Close struct {
    ObjectType byte // 'S' = prepared statement, 'P' = portal
    Name       string
}

func (*Close) Decode Uses

func (dst *Close) Decode(src []byte) error

func (*Close) Encode Uses

func (src *Close) Encode(dst []byte) []byte

func (*Close) Frontend Uses

func (*Close) Frontend()

func (*Close) MarshalJSON Uses

func (src *Close) MarshalJSON() ([]byte, error)

type CloseComplete Uses

type CloseComplete struct{}

func (*CloseComplete) Backend Uses

func (*CloseComplete) Backend()

func (*CloseComplete) Decode Uses

func (dst *CloseComplete) Decode(src []byte) error

func (*CloseComplete) Encode Uses

func (src *CloseComplete) Encode(dst []byte) []byte

func (*CloseComplete) MarshalJSON Uses

func (src *CloseComplete) MarshalJSON() ([]byte, error)

type CommandComplete Uses

type CommandComplete struct {
    CommandTag string
}

func (*CommandComplete) Backend Uses

func (*CommandComplete) Backend()

func (*CommandComplete) Decode Uses

func (dst *CommandComplete) Decode(src []byte) error

func (*CommandComplete) Encode Uses

func (src *CommandComplete) Encode(dst []byte) []byte

func (*CommandComplete) MarshalJSON Uses

func (src *CommandComplete) MarshalJSON() ([]byte, error)

type CopyBothResponse Uses

type CopyBothResponse struct {
    OverallFormat     byte
    ColumnFormatCodes []uint16
}

func (*CopyBothResponse) Backend Uses

func (*CopyBothResponse) Backend()

func (*CopyBothResponse) Decode Uses

func (dst *CopyBothResponse) Decode(src []byte) error

func (*CopyBothResponse) Encode Uses

func (src *CopyBothResponse) Encode(dst []byte) []byte

func (*CopyBothResponse) MarshalJSON Uses

func (src *CopyBothResponse) MarshalJSON() ([]byte, error)

type CopyData Uses

type CopyData struct {
    Data []byte
}

func (*CopyData) Backend Uses

func (*CopyData) Backend()

func (*CopyData) Decode Uses

func (dst *CopyData) Decode(src []byte) error

func (*CopyData) Encode Uses

func (src *CopyData) Encode(dst []byte) []byte

func (*CopyData) Frontend Uses

func (*CopyData) Frontend()

func (*CopyData) MarshalJSON Uses

func (src *CopyData) MarshalJSON() ([]byte, error)

type CopyDone Uses

type CopyDone struct {
}

func (*CopyDone) Backend Uses

func (*CopyDone) Backend()

func (*CopyDone) Decode Uses

func (dst *CopyDone) Decode(src []byte) error

func (*CopyDone) Encode Uses

func (src *CopyDone) Encode(dst []byte) []byte

func (*CopyDone) MarshalJSON Uses

func (src *CopyDone) MarshalJSON() ([]byte, error)

type CopyFail Uses

type CopyFail struct {
    Message string
}

func (*CopyFail) Backend Uses

func (*CopyFail) Backend()

func (*CopyFail) Decode Uses

func (dst *CopyFail) Decode(src []byte) error

func (*CopyFail) Encode Uses

func (src *CopyFail) Encode(dst []byte) []byte

func (*CopyFail) MarshalJSON Uses

func (src *CopyFail) MarshalJSON() ([]byte, error)

type CopyInResponse Uses

type CopyInResponse struct {
    OverallFormat     byte
    ColumnFormatCodes []uint16
}

func (*CopyInResponse) Backend Uses

func (*CopyInResponse) Backend()

func (*CopyInResponse) Decode Uses

func (dst *CopyInResponse) Decode(src []byte) error

func (*CopyInResponse) Encode Uses

func (src *CopyInResponse) Encode(dst []byte) []byte

func (*CopyInResponse) MarshalJSON Uses

func (src *CopyInResponse) MarshalJSON() ([]byte, error)

type CopyOutResponse Uses

type CopyOutResponse struct {
    OverallFormat     byte
    ColumnFormatCodes []uint16
}

func (*CopyOutResponse) Backend Uses

func (*CopyOutResponse) Backend()

func (*CopyOutResponse) Decode Uses

func (dst *CopyOutResponse) Decode(src []byte) error

func (*CopyOutResponse) Encode Uses

func (src *CopyOutResponse) Encode(dst []byte) []byte

func (*CopyOutResponse) MarshalJSON Uses

func (src *CopyOutResponse) MarshalJSON() ([]byte, error)

type DataRow Uses

type DataRow struct {
    Values [][]byte
}

func (*DataRow) Backend Uses

func (*DataRow) Backend()

func (*DataRow) Decode Uses

func (dst *DataRow) Decode(src []byte) error

func (*DataRow) Encode Uses

func (src *DataRow) Encode(dst []byte) []byte

func (*DataRow) MarshalJSON Uses

func (src *DataRow) MarshalJSON() ([]byte, error)

type Describe Uses

type Describe struct {
    ObjectType byte // 'S' = prepared statement, 'P' = portal
    Name       string
}

func (*Describe) Decode Uses

func (dst *Describe) Decode(src []byte) error

func (*Describe) Encode Uses

func (src *Describe) Encode(dst []byte) []byte

func (*Describe) Frontend Uses

func (*Describe) Frontend()

func (*Describe) MarshalJSON Uses

func (src *Describe) MarshalJSON() ([]byte, error)

type EmptyQueryResponse Uses

type EmptyQueryResponse struct{}

func (*EmptyQueryResponse) Backend Uses

func (*EmptyQueryResponse) Backend()

func (*EmptyQueryResponse) Decode Uses

func (dst *EmptyQueryResponse) Decode(src []byte) error

func (*EmptyQueryResponse) Encode Uses

func (src *EmptyQueryResponse) Encode(dst []byte) []byte

func (*EmptyQueryResponse) MarshalJSON Uses

func (src *EmptyQueryResponse) MarshalJSON() ([]byte, error)

type ErrorResponse Uses

type ErrorResponse struct {
    Severity         string
    Code             string
    Message          string
    Detail           string
    Hint             string
    Position         int32
    InternalPosition int32
    InternalQuery    string
    Where            string
    SchemaName       string
    TableName        string
    ColumnName       string
    DataTypeName     string
    ConstraintName   string
    File             string
    Line             int32
    Routine          string

    UnknownFields map[byte]string
}

func (*ErrorResponse) Backend Uses

func (*ErrorResponse) Backend()

func (*ErrorResponse) Decode Uses

func (dst *ErrorResponse) Decode(src []byte) error

func (*ErrorResponse) Encode Uses

func (src *ErrorResponse) Encode(dst []byte) []byte

type Execute Uses

type Execute struct {
    Portal  string
    MaxRows uint32
}

func (*Execute) Decode Uses

func (dst *Execute) Decode(src []byte) error

func (*Execute) Encode Uses

func (src *Execute) Encode(dst []byte) []byte

func (*Execute) Frontend Uses

func (*Execute) Frontend()

func (*Execute) MarshalJSON Uses

func (src *Execute) MarshalJSON() ([]byte, error)

type FieldDescription Uses

type FieldDescription struct {
    Name                 string
    TableOID             uint32
    TableAttributeNumber uint16
    DataTypeOID          uint32
    DataTypeSize         int16
    TypeModifier         int32
    Format               int16
}

type Flush Uses

type Flush struct{}

func (*Flush) Decode Uses

func (dst *Flush) Decode(src []byte) error

func (*Flush) Encode Uses

func (src *Flush) Encode(dst []byte) []byte

func (*Flush) Frontend Uses

func (*Flush) Frontend()

func (*Flush) MarshalJSON Uses

func (src *Flush) MarshalJSON() ([]byte, error)

type Frontend Uses

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

func NewFrontend Uses

func NewFrontend(r io.Reader, w io.Writer) (*Frontend, error)

func (*Frontend) Receive Uses

func (b *Frontend) Receive() (BackendMessage, error)

func (*Frontend) Send Uses

func (b *Frontend) Send(msg FrontendMessage) error

type FrontendMessage Uses

type FrontendMessage interface {
    Message
    Frontend() // no-op method to distinguish frontend from backend methods
}

type FunctionCallResponse Uses

type FunctionCallResponse struct {
    Result []byte
}

func (*FunctionCallResponse) Backend Uses

func (*FunctionCallResponse) Backend()

func (*FunctionCallResponse) Decode Uses

func (dst *FunctionCallResponse) Decode(src []byte) error

func (*FunctionCallResponse) Encode Uses

func (src *FunctionCallResponse) Encode(dst []byte) []byte

func (*FunctionCallResponse) MarshalJSON Uses

func (src *FunctionCallResponse) MarshalJSON() ([]byte, error)

type Message Uses

type Message interface {
    // Decode is allowed and expected to retain a reference to data after
    // returning (unlike encoding.BinaryUnmarshaler).
    Decode(data []byte) error

    // Encode appends itself to dst and returns the new buffer.
    Encode(dst []byte) []byte
}

Message is the interface implemented by an object that can decode and encode a particular PostgreSQL message.

type NoData Uses

type NoData struct{}

func (*NoData) Backend Uses

func (*NoData) Backend()

func (*NoData) Decode Uses

func (dst *NoData) Decode(src []byte) error

func (*NoData) Encode Uses

func (src *NoData) Encode(dst []byte) []byte

func (*NoData) MarshalJSON Uses

func (src *NoData) MarshalJSON() ([]byte, error)

type NoticeResponse Uses

type NoticeResponse ErrorResponse

func (*NoticeResponse) Backend Uses

func (*NoticeResponse) Backend()

func (*NoticeResponse) Decode Uses

func (dst *NoticeResponse) Decode(src []byte) error

func (*NoticeResponse) Encode Uses

func (src *NoticeResponse) Encode(dst []byte) []byte

type NotificationResponse Uses

type NotificationResponse struct {
    PID     uint32
    Channel string
    Payload string
}

func (*NotificationResponse) Backend Uses

func (*NotificationResponse) Backend()

func (*NotificationResponse) Decode Uses

func (dst *NotificationResponse) Decode(src []byte) error

func (*NotificationResponse) Encode Uses

func (src *NotificationResponse) Encode(dst []byte) []byte

func (*NotificationResponse) MarshalJSON Uses

func (src *NotificationResponse) MarshalJSON() ([]byte, error)

type ParameterDescription Uses

type ParameterDescription struct {
    ParameterOIDs []uint32
}

func (*ParameterDescription) Backend Uses

func (*ParameterDescription) Backend()

func (*ParameterDescription) Decode Uses

func (dst *ParameterDescription) Decode(src []byte) error

func (*ParameterDescription) Encode Uses

func (src *ParameterDescription) Encode(dst []byte) []byte

func (*ParameterDescription) MarshalJSON Uses

func (src *ParameterDescription) MarshalJSON() ([]byte, error)

type ParameterStatus Uses

type ParameterStatus struct {
    Name  string
    Value string
}

func (*ParameterStatus) Backend Uses

func (*ParameterStatus) Backend()

func (*ParameterStatus) Decode Uses

func (dst *ParameterStatus) Decode(src []byte) error

func (*ParameterStatus) Encode Uses

func (src *ParameterStatus) Encode(dst []byte) []byte

func (*ParameterStatus) MarshalJSON Uses

func (ps *ParameterStatus) MarshalJSON() ([]byte, error)

type Parse Uses

type Parse struct {
    Name          string
    Query         string
    ParameterOIDs []uint32
}

func (*Parse) Decode Uses

func (dst *Parse) Decode(src []byte) error

func (*Parse) Encode Uses

func (src *Parse) Encode(dst []byte) []byte

func (*Parse) Frontend Uses

func (*Parse) Frontend()

func (*Parse) MarshalJSON Uses

func (src *Parse) MarshalJSON() ([]byte, error)

type ParseComplete Uses

type ParseComplete struct{}

func (*ParseComplete) Backend Uses

func (*ParseComplete) Backend()

func (*ParseComplete) Decode Uses

func (dst *ParseComplete) Decode(src []byte) error

func (*ParseComplete) Encode Uses

func (src *ParseComplete) Encode(dst []byte) []byte

func (*ParseComplete) MarshalJSON Uses

func (src *ParseComplete) MarshalJSON() ([]byte, error)

type PasswordMessage Uses

type PasswordMessage struct {
    Password string
}

func (*PasswordMessage) Decode Uses

func (dst *PasswordMessage) Decode(src []byte) error

func (*PasswordMessage) Encode Uses

func (src *PasswordMessage) Encode(dst []byte) []byte

func (*PasswordMessage) Frontend Uses

func (*PasswordMessage) Frontend()

func (*PasswordMessage) MarshalJSON Uses

func (src *PasswordMessage) MarshalJSON() ([]byte, error)

type PortalSuspended Uses

type PortalSuspended struct{}

func (*PortalSuspended) Backend Uses

func (*PortalSuspended) Backend()

func (*PortalSuspended) Decode Uses

func (dst *PortalSuspended) Decode(src []byte) error

func (*PortalSuspended) Encode Uses

func (src *PortalSuspended) Encode(dst []byte) []byte

func (*PortalSuspended) MarshalJSON Uses

func (src *PortalSuspended) MarshalJSON() ([]byte, error)

type Query Uses

type Query struct {
    String string
}

func (*Query) Decode Uses

func (dst *Query) Decode(src []byte) error

func (*Query) Encode Uses

func (src *Query) Encode(dst []byte) []byte

func (*Query) Frontend Uses

func (*Query) Frontend()

func (*Query) MarshalJSON Uses

func (src *Query) MarshalJSON() ([]byte, error)

type ReadyForQuery Uses

type ReadyForQuery struct {
    TxStatus byte
}

func (*ReadyForQuery) Backend Uses

func (*ReadyForQuery) Backend()

func (*ReadyForQuery) Decode Uses

func (dst *ReadyForQuery) Decode(src []byte) error

func (*ReadyForQuery) Encode Uses

func (src *ReadyForQuery) Encode(dst []byte) []byte

func (*ReadyForQuery) MarshalJSON Uses

func (src *ReadyForQuery) MarshalJSON() ([]byte, error)

type RowDescription Uses

type RowDescription struct {
    Fields []FieldDescription
}

func (*RowDescription) Backend Uses

func (*RowDescription) Backend()

func (*RowDescription) Decode Uses

func (dst *RowDescription) Decode(src []byte) error

func (*RowDescription) Encode Uses

func (src *RowDescription) Encode(dst []byte) []byte

func (*RowDescription) MarshalJSON Uses

func (src *RowDescription) MarshalJSON() ([]byte, error)

type SASLInitialResponse Uses

type SASLInitialResponse struct {
    AuthMechanism string
    Data          []byte
}

func (*SASLInitialResponse) Decode Uses

func (dst *SASLInitialResponse) Decode(src []byte) error

func (*SASLInitialResponse) Encode Uses

func (src *SASLInitialResponse) Encode(dst []byte) []byte

func (*SASLInitialResponse) Frontend Uses

func (*SASLInitialResponse) Frontend()

func (*SASLInitialResponse) MarshalJSON Uses

func (src *SASLInitialResponse) MarshalJSON() ([]byte, error)

type SASLResponse Uses

type SASLResponse struct {
    Data []byte
}

func (*SASLResponse) Decode Uses

func (dst *SASLResponse) Decode(src []byte) error

func (*SASLResponse) Encode Uses

func (src *SASLResponse) Encode(dst []byte) []byte

func (*SASLResponse) Frontend Uses

func (*SASLResponse) Frontend()

func (*SASLResponse) MarshalJSON Uses

func (src *SASLResponse) MarshalJSON() ([]byte, error)

type StartupMessage Uses

type StartupMessage struct {
    ProtocolVersion uint32
    Parameters      map[string]string
}

func (*StartupMessage) Decode Uses

func (dst *StartupMessage) Decode(src []byte) error

func (*StartupMessage) Encode Uses

func (src *StartupMessage) Encode(dst []byte) []byte

func (*StartupMessage) Frontend Uses

func (*StartupMessage) Frontend()

func (*StartupMessage) MarshalJSON Uses

func (src *StartupMessage) MarshalJSON() ([]byte, error)

type Sync Uses

type Sync struct{}

func (*Sync) Decode Uses

func (dst *Sync) Decode(src []byte) error

func (*Sync) Encode Uses

func (src *Sync) Encode(dst []byte) []byte

func (*Sync) Frontend Uses

func (*Sync) Frontend()

func (*Sync) MarshalJSON Uses

func (src *Sync) MarshalJSON() ([]byte, error)

type Terminate Uses

type Terminate struct{}

func (*Terminate) Decode Uses

func (dst *Terminate) Decode(src []byte) error

func (*Terminate) Encode Uses

func (src *Terminate) Encode(dst []byte) []byte

func (*Terminate) Frontend Uses

func (*Terminate) Frontend()

func (*Terminate) MarshalJSON Uses

func (src *Terminate) MarshalJSON() ([]byte, error)

Package pgproto3 imports 11 packages (graph) and is imported by 19 packages. Updated 2019-06-08. Refresh now. Tools for package owners.