Documentation
¶
Index ¶
- Constants
- Variables
- func Initialize(replications []*Config) error
- func Poll(ctx context.Context, conn *pgx.Conn, tables []string, batchSize int, ...) error
- func SendToHttpDestination(spec *DestinationSpec, change *Change) error
- func SendToSqsDestination(spec *DestinationSpec, change *Change) error
- func StartReplication(c *Config) error
- type Action
- type Change
- type ChangeHandler
- type Config
- type DestinationKind
- type DestinationList
- type DestinationSpec
- type Map
- type Mapping
- type Message
- type Mode
- type OldKeys
- type WalData
Constants ¶
View Source
const ( DefaultGroupCount = 10 DefaultRetryMaxAttempts = 10 )
Variables ¶
View Source
var IgnoreMessageError = errors.New("ignore this message and continue replication")
Functions ¶
func Initialize ¶
func Poll ¶ added in v1.1.25
func Poll(ctx context.Context, conn *pgx.Conn, tables []string, batchSize int, handle ChangeHandler) error
Poll delivers each table's undelivered outbox rows to handle until a short batch, marking each delivered.
func SendToHttpDestination ¶
func SendToHttpDestination(spec *DestinationSpec, change *Change) error
func SendToSqsDestination ¶
func SendToSqsDestination(spec *DestinationSpec, change *Change) error
func StartReplication ¶
Types ¶
type Action ¶
type Action = string
const ActionDelete Action = "delete"
const ActionInsert Action = "insert"
const ActionUpdate Action = "update"
type ChangeHandler ¶ added in v1.1.25
type Config ¶
type Config struct {
LogLevel zapcore.Level `cpln:"default:info;mapper:ZapLogLevelMapper"`
Host string `json:"-"`
Port string `json:"-"`
User string `json:"-"`
Database string `json:"-"`
Password string `json:"-"`
Mode Mode `json:"mode"`
Slot string `json:"slot"`
WalAcknowledgementFrequency time.Duration `cpln:"default:30s" json:"-"`
PollInterval time.Duration `cpln:"default:5s" json:"-"`
PollBatchSize int `cpln:"default:100" json:"-"`
Destinations DestinationList `json:"destinations"`
}
type DestinationKind ¶
type DestinationKind string
const ( DestinationKindSQS DestinationKind = "sqs" DestinationKindHTTP DestinationKind = "http" )
type DestinationList ¶
type DestinationList []*DestinationSpec
func (DestinationList) HandleChange ¶
func (l DestinationList) HandleChange(change *Change) error
func (DestinationList) Tables ¶
func (l DestinationList) Tables() []string
type DestinationSpec ¶
type DestinationSpec struct {
Map `json:",inline"`
Kind DestinationKind `json:"kind"`
Parameters map[string]any `json:"parameters"`
}
func (*DestinationSpec) HandleChange ¶
func (s *DestinationSpec) HandleChange(change *Change) error
type Map ¶
type Mode ¶ added in v1.1.25
type Mode = string
const ModeLogical Mode = "logical"
const ModePoll Mode = "poll"
Click to show internal directories.
Click to hide internal directories.