Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeMem ¶
func ServeMem(server *pg.Server) (ConnectFunc, ShutdownFunc, error)
ServeMem serves postgres on in-memory connections. TLS does not work here, as it relies on the OS to buffer and discard data.
Types ¶
type ConnectFunc ¶
ConnectFunc is a function to connect to a server.
type HandlerFunc ¶
HandlerFunc implements a postgres query handler with a function.
func (HandlerFunc) HandleQuery ¶
func (h HandlerFunc) HandleQuery(ctx context.Context, w pg.QueryResultWriter, q pg.Query) error
HandleQuery calls the user's query handler function.
type ResultSet ¶
type ResultSet struct { Columns []pg.ColumnInfo Data [][]string ResultTag string }
ResultSet is a QueryResultWriter that accumulates results in a slice.
func (*ResultSet) WriteHeader ¶
func (rs *ResultSet) WriteHeader(cols ...pg.ColumnInfo) error
WriteHeader writes headers to the result set.
func (*ResultSet) WriteRowText ¶
WriteRowText writes a row to the result set.
type ShutdownFunc ¶
type ShutdownFunc func() error
ShutdownFunc is a function to use to shut down a test fixture. This function will send a shutdown signal and then wait for completion.
Click to show internal directories.
Click to hide internal directories.