Documentation
¶
Index ¶
- type Config
- func (c *Config) DSN() string
- func (c *Config) DSNWithoutSSL() string
- func (c *Config) GetSnapshotTables(publicationInfo *publication.Config) (publication.Tables, error)
- func (c *Config) IsSnapshotOnlyMode() bool
- func (c *Config) Print()
- func (c *Config) ReplicationDSN() string
- func (c *Config) SetDefault()
- func (c *Config) Validate() error
- type ExtensionSupport
- type HeartbeatConfig
- type LoggerConfig
- type MetricConfig
- type SnapshotConfig
- type SnapshotMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Heartbeat HeartbeatConfig `json:"heartbeat" yaml:"heartbeat"`
Logger LoggerConfig `json:"logger" yaml:"logger"`
Host string `json:"host" yaml:"host"`
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password"`
Database string `json:"database" yaml:"database"`
Publication publication.Config `json:"publication" yaml:"publication"`
Slot slot.Config `json:"slot" yaml:"slot"`
Snapshot SnapshotConfig `json:"snapshot" yaml:"snapshot"`
Port int `json:"port" yaml:"port"`
Metric MetricConfig `json:"metric" yaml:"metric"`
DebugMode bool `json:"debugMode" yaml:"debugMode"`
ExtensionSupport ExtensionSupport `json:"extensionSupport" yaml:"extensionSupport"`
}
func ReadConfigJSON ¶
func ReadConfigYAML ¶
func (*Config) DSN ¶
DSN returns a normal PostgreSQL connection string for regular database operations (publication, metadata, snapshot chunks, etc.)
func (*Config) DSNWithoutSSL ¶
func (*Config) GetSnapshotTables ¶ added in v1.0.3
func (c *Config) GetSnapshotTables(publicationInfo *publication.Config) (publication.Tables, error)
GetSnapshotTables returns the tables to snapshot based on the configuration and publication info. For snapshot_only mode: uses snapshot.tables (independent from publication) For initial mode (snapshot + CDC):
- If snapshot.tables specified: validates it's a subset of publication tables and returns snapshot.tables
- If snapshot.tables not specified: returns all tables from publication
func (*Config) IsSnapshotOnlyMode ¶ added in v1.0.3
IsSnapshotOnlyMode returns true if snapshot is enabled and mode is snapshot_only
func (*Config) ReplicationDSN ¶ added in v1.0.3
ReplicationDSN returns a replication connection string for CDC streaming This connection counts against max_wal_senders limit
func (*Config) SetDefault ¶
func (c *Config) SetDefault()
type ExtensionSupport ¶ added in v1.0.3
type ExtensionSupport struct {
EnableTimeScaleDB bool `json:"enableTimeScaleDB" yaml:"EnableTimeScaleDB"`
}
type HeartbeatConfig ¶ added in v1.0.4
type LoggerConfig ¶
type MetricConfig ¶
type MetricConfig struct {
Port int `json:"port" yaml:"port"`
}
type SnapshotConfig ¶ added in v1.0.3
type SnapshotConfig struct {
Mode SnapshotMode `json:"mode" yaml:"mode"`
InstanceID string `json:"instanceId" yaml:"instanceId"`
ID string `json:"id" yaml:"id"`
Tables publication.Tables `json:"tables" yaml:"tables"`
ChunkSize int64 `json:"chunkSize" yaml:"chunkSize"`
ClaimTimeout time.Duration `json:"claimTimeout" yaml:"claimTimeout"`
HeartbeatInterval time.Duration `json:"heartbeatInterval" yaml:"heartbeatInterval"`
Enabled bool `json:"enabled" yaml:"enabled"`
Resnapshot bool `json:"resnapshot" yaml:"resnapshot"`
}
func (*SnapshotConfig) Validate ¶ added in v1.0.3
func (s *SnapshotConfig) Validate() error
type SnapshotMode ¶ added in v1.0.3
type SnapshotMode string
const ( SnapshotModeInitial SnapshotMode = "initial" SnapshotModeNever SnapshotMode = "never" SnapshotModeSnapshotOnly SnapshotMode = "snapshot_only" )
Click to show internal directories.
Click to hide internal directories.