Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// Upstream endpoint
URL string
// Path of database on upstream server.
Path string
// Underlying HTTP client
HTTPClient *http.Client
}
Client represents an client for a streaming Litestream HTTP server.
func (*Client) Stream ¶
func (c *Client) Stream(ctx context.Context, pos litestream.Pos) (litestream.StreamReader, error)
Stream returns a snapshot and continuous stream of WAL updates.
type StreamReader ¶
type StreamReader struct {
// contains filtered or unexported fields
}
StreamReader represents an optional snapshot followed by a continuous stream of WAL updates. It is used to implement live read replication from a single primary Litestream server to one or more remote Litestream replicas.
func (*StreamReader) Close ¶
func (r *StreamReader) Close() (err error)
Close closes the underlying reader.
func (*StreamReader) Next ¶
func (r *StreamReader) Next() (*litestream.StreamRecordHeader, error)
Next returns the next available record. This call will block until a record is available. After calling Next(), read the payload from the reader using Read() until io.EOF is reached.
func (*StreamReader) PageSize ¶
func (r *StreamReader) PageSize() int
PageSize returns the page size on the remote database.