Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) Authenticate ¶
Authenticate performs a simple authentication using the PostgreSQL wire protocol. The method fails whenever an unexpected message server message type/state has been returned of the connection has not been authenticated.
func (*Client) Handshake ¶
Handshake performs a simple handshake over the underlaying connection. A handshake consists out of introducing/publishing the client version and connection preferences and the writing of (metadata) parameters identifying the given client.
func (*Client) ReadyForQuery ¶
ReadyForQuery awaits till the underlaying network connection returns a ready for query message. This message indicates that the server is ready to accept a new typed message to execute a action.
type Reader ¶
Reader represents a low level PostgreSQL client reader allowing a user to read messages through the PostgreSQL wire protocol. This implementation is mainly used for mocking/testing purposes.
func NewReader ¶
NewReader constructs a new PostgreSQL wire protocol reader using the default buffer size.
func (*Reader) ReadTypedMsg ¶
func (buffer *Reader) ReadTypedMsg() (types.ServerMessage, int, error)
ReadTypedMsg reads a message from the provided reader, returning its type code and body. It returns the message type, number of bytes read, and an error if there was one.
type Writer ¶
Writer represents a low level PostgreSQL client writer allowing a user to write messages using the PostgreSQL wire protocol. This implementation is mainly used for mocking/testing purposes.
func (*Writer) Start ¶
func (buffer *Writer) Start(t types.ClientMessage)
Start resets the buffer writer and starts a new message with the given message type. The message type (byte) and reserved message length bytes (int32) are written to the underlaying bytes buffer.