Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct { Name string `json:"name"` Type string `json:"type"` Value json.RawMessage `json:"value"` }
Column contains column information.
type Conn ¶
type Conn struct {
*pgx.Conn
}
Conn adds more methods to pgx.Conn.
func (*Conn) ConfirmedFlushLSN ¶
ConfirmedFlushLSN fetches the confirmed flush LSN.
func (*Conn) GetPublicationTables ¶ added in v0.0.12
GetPublicationTables checks if the publication exists for a given table.
type PgReplicator ¶
type PgReplicator struct {
// contains filtered or unexported fields
}
PgReplicator is a component that replicates Postgres data.
func New ¶
func New(connStr string, publication Publication) (*PgReplicator, error)
New creates a new Postgres replicator.
func (*PgReplicator) Shutdown ¶
func (r *PgReplicator) Shutdown()
Shutdown stops the replication by closing the Postgres connection and the feed channel.
func (*PgReplicator) StartReplication ¶
StartReplication starts replicattion.
type PrimaryKey ¶
PrimaryKey contains primary key information.
type Publication ¶
type Publication string
Publication is the name a publication. Currently it corresponds to a table's name.
func (Publication) FullName ¶
func (p Publication) FullName() string
FullName is the name used to create a publication in Postgres.
type Record ¶
type Record struct { Action string `json:"action"` XID int64 `json:"xid"` Lsn string `json:"lsn"` EndLsn string `json:"nextlsn"` Timestamp string `json:"timestamp"` Schema string `json:"schema"` Table string `json:"table"` Columns []Column `json:"columns"` PrimaryKey []PrimaryKey `json:"pk"` }
Record is the WAL record information encoded in JSON.