Documentation
¶
Index ¶
- func Destroy(ctx context.Context, pgURL, replicationSlotName string) error
- func Init(ctx context.Context, pgURL, replicationSlotName string) error
- func Run(ctx context.Context, logger loglib.Logger, config *Config, init bool, ...) error
- func Snapshot(ctx context.Context, logger loglib.Logger, config *Config, ...) error
- type Config
- type ConfigStatus
- type InitStatus
- type KafkaListenerConfig
- type KafkaProcessorConfig
- type ListenerConfig
- type MigrationStatus
- type PostgresListenerConfig
- type PostgresProcessorConfig
- type ProcessorConfig
- type ReplicationSlotStatus
- type SchemaStatus
- type SearchProcessorConfig
- type SourceStatus
- type Status
- type StatusChecker
- type StatusErrors
- type TransformationRulesStatus
- type WebhookProcessorConfig
- type WebhookSubscriptionStoreConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Destroy ¶ added in v0.8.0
Destroy removes the pgstream state from the postgres database provided, as well as removing the replication slot.
func Init ¶
Init initialises the pgstream state in the postgres database provided, along with creating the relevant replication slot if it doesn't already exist.
Types ¶
type Config ¶
type Config struct {
Listener ListenerConfig
Processor ProcessorConfig
}
func (*Config) PostgresReplicationSlot ¶ added in v0.5.0
func (*Config) RequiredTables ¶ added in v0.6.4
func (*Config) SourcePostgresURL ¶ added in v0.5.0
type ConfigStatus ¶ added in v0.5.0
func (*ConfigStatus) PrettyPrint ¶ added in v0.5.0
func (cs *ConfigStatus) PrettyPrint() string
type InitStatus ¶ added in v0.5.0
type InitStatus struct {
PgstreamSchema *SchemaStatus
Migration *MigrationStatus
ReplicationSlot *ReplicationSlotStatus
}
func (*InitStatus) GetErrors ¶ added in v0.5.0
func (is *InitStatus) GetErrors() []string
GetErrors aggregates all errors from the initialisation status.
func (*InitStatus) PrettyPrint ¶ added in v0.5.0
func (is *InitStatus) PrettyPrint() string
type KafkaListenerConfig ¶
type KafkaListenerConfig struct {
Reader kafka.ReaderConfig
Checkpointer kafkacheckpoint.Config
}
type KafkaProcessorConfig ¶
type KafkaProcessorConfig struct {
Writer *kafkaprocessor.Config
}
type ListenerConfig ¶
type ListenerConfig struct {
Postgres *PostgresListenerConfig
Kafka *KafkaListenerConfig
}
func (*ListenerConfig) IsValid ¶ added in v0.5.0
func (c *ListenerConfig) IsValid() error
type MigrationStatus ¶ added in v0.5.0
type PostgresListenerConfig ¶
type PostgresListenerConfig struct {
URL string
Replication pgreplication.Config
RetryPolicy backoff.Config
Snapshot *snapshotbuilder.SnapshotListenerConfig
}
type PostgresProcessorConfig ¶ added in v0.4.0
type ProcessorConfig ¶
type ProcessorConfig struct {
Kafka *KafkaProcessorConfig
Search *SearchProcessorConfig
Webhook *WebhookProcessorConfig
Postgres *PostgresProcessorConfig
Injector *injector.Config
Transformer *transformer.Config
Filter *filter.Config
}
func (*ProcessorConfig) IsValid ¶ added in v0.5.0
func (c *ProcessorConfig) IsValid() error
type ReplicationSlotStatus ¶ added in v0.5.0
type SchemaStatus ¶ added in v0.5.0
type SearchProcessorConfig ¶
type SearchProcessorConfig struct {
Indexer search.IndexerConfig
Store store.Config
Retrier search.StoreRetryConfig
}
type SourceStatus ¶ added in v0.5.0
func (*SourceStatus) PrettyPrint ¶ added in v0.5.0
func (ss *SourceStatus) PrettyPrint() string
type Status ¶ added in v0.5.0
type Status struct {
Init *InitStatus
Config *ConfigStatus
TransformationRules *TransformationRulesStatus
Source *SourceStatus
}
func (*Status) GetErrors ¶ added in v0.5.0
func (s *Status) GetErrors() StatusErrors
func (*Status) PrettyPrint ¶ added in v0.5.0
type StatusChecker ¶ added in v0.5.0
type StatusChecker struct {
// contains filtered or unexported fields
}
StatusChecker is responsible for validating the status of the pgstream setup in a PostgreSQL database. It performs checks on the source database connection, initialization status (schema, migrations, replication slot), and transformation rules. It provides detailed status information, including errors, to help diagnose issues with the pgstream configuration and setup.
func NewStatusChecker ¶ added in v0.5.0
func NewStatusChecker() *StatusChecker
func (*StatusChecker) Status ¶ added in v0.5.0
Status retrieves the overall status of the pgstream setup, including the source database connection status, initialization status (schema, migrations, replication slot), and transformation rules validation status. It returns a detailed status report that includes any errors encountered during the checks, helping to diagnose issues with the pgstream configuration and setup.
type StatusErrors ¶ added in v0.5.0
func (StatusErrors) Keys ¶ added in v0.5.0
func (se StatusErrors) Keys() []string
type TransformationRulesStatus ¶ added in v0.5.0
func (*TransformationRulesStatus) PrettyPrint ¶ added in v0.5.0
func (trs *TransformationRulesStatus) PrettyPrint() string
type WebhookProcessorConfig ¶
type WebhookProcessorConfig struct {
Notifier notifier.Config
SubscriptionServer server.Config
SubscriptionStore WebhookSubscriptionStoreConfig
}