Documentation
¶
Overview ¶
Package postgres provides a PostgreSQL CDC source implementation using pgstream.
Package postgres provides a PostgreSQL CDC source implementation using pgstream.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingConnectionURL is returned when the connection URL is not provided. ErrMissingConnectionURL = errors.New("postgres: connection URL is required") // ErrMissingSlotName is returned when the replication slot name is not provided. ErrMissingSlotName = errors.New("postgres: replication slot name is required") // ErrMissingPublicationName is returned when the publication name is not provided. ErrMissingPublicationName = errors.New("postgres: publication name is required") // ErrAlreadyStarted is returned when Start is called on an already started source. ErrAlreadyStarted = errors.New("postgres: source already started") // ErrNotStarted is returned when Stop is called on a source that hasn't started. ErrNotStarted = errors.New("postgres: source not started") // ErrConnectionFailed is returned when the connection to PostgreSQL fails. ErrConnectionFailed = errors.New("postgres: connection failed") // ErrReplicationFailed is returned when replication streaming fails. ErrReplicationFailed = errors.New("postgres: replication failed") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
source.Config
// ConnectionURL is the PostgreSQL connection URL.
ConnectionURL string
// SlotName is the name of the replication slot.
SlotName string
// PublicationName is the name of the publication to subscribe to.
PublicationName string
// Tables is a list of tables to capture (empty means all tables in publication).
Tables []string
// ReconnectInterval is the interval between reconnection attempts.
ReconnectInterval time.Duration
// MaxReconnectAttempts is the maximum number of reconnection attempts (0 = unlimited).
MaxReconnectAttempts int
// EventBufferSize is the size of the internal event buffer.
EventBufferSize int
}
Config holds configuration for the PostgreSQL CDC source.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a PostgreSQL CDC source that uses pgstream for logical replication.
Click to show internal directories.
Click to hide internal directories.