follow

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Follower

type Follower interface {
	Follow(ctx context.Context, startingpos pglogrepl.LSN) error
}

Follower is the interface for things that can follow a WAL

type WalFollower

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

WalFollower watches the WAL and writes changes into the cache

func NewWalFollower

func NewWalFollower(conn *pgconn.PgConn, mapping []config.InternalTableMapping, cache *cache.Cache) *WalFollower

NewWalFollower creates a new WalFollower for postgres. The conn must be made with the `replication` flag set.

func (*WalFollower) Follow

func (f *WalFollower) Follow(ctx context.Context, startpos pglogrepl.LSN) error

Follow starts watching the replication log at startpos. It uses the config's InternalTableMapping to translate WAL events into relationships, which are then written to the cache. Follow (and replication connections in general) are not safe to share across threads. Events should be read from the cache to process them in parallel.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL