config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load() error

func LoadFile

func LoadFile(file string) error

func ParseStreamConfig

func ParseStreamConfig() (*stream.Config, error)

Types

type BackoffConfig

type BackoffConfig struct {
	Exponential *ExponentialBackoffConfig `mapstructure:"exponential" yaml:"exponential"`
	Constant    *ConstantBackoffConfig    `mapstructure:"constant" yaml:"constant"`
}

type BatchConfig

type BatchConfig struct {
	Timeout       int `mapstructure:"timeout" yaml:"timeout"`
	Size          int `mapstructure:"size" yaml:"size"`
	MaxBytes      int `mapstructure:"max_bytes" yaml:"max_bytes"`
	MaxQueueBytes int `mapstructure:"max_queue_bytes" yaml:"max_queue_bytes"`
}

type ColumnTransformersConfig

type ColumnTransformersConfig struct {
	Name              string         `mapstructure:"name" yaml:"name"`
	Parameters        map[string]any `mapstructure:"parameters" yaml:"parameters"`
	DynamicParameters map[string]any `mapstructure:"dynamic_parameters" yaml:"dynamic_parameters"`
}

type ConstantBackoffConfig

type ConstantBackoffConfig struct {
	MaxRetries int `mapstructure:"max_retries" yaml:"max_retries"`
	Interval   int `mapstructure:"interval" yaml:"interval"`
}

type ConsumerGroupConfig

type ConsumerGroupConfig struct {
	ID          string `mapstructure:"id" yaml:"id"`
	StartOffset string `mapstructure:"start_offset" yaml:"start_offset"`
}

type ExponentialBackoffConfig

type ExponentialBackoffConfig struct {
	MaxRetries      int `mapstructure:"max_retries" yaml:"max_retries"`
	InitialInterval int `mapstructure:"initial_interval" yaml:"initial_interval"`
	MaxInterval     int `mapstructure:"max_interval" yaml:"max_interval"`
}

type FilterConfig

type FilterConfig struct {
	IncludeTables []string `mapstructure:"include_tables" yaml:"include_tables"`
	ExcludeTables []string `mapstructure:"exclude_tables" yaml:"exclude_tables"`
}

type InjectorConfig

type InjectorConfig struct {
	Enabled      bool   `mapstructure:"enabled" yaml:"enabled"`
	SchemalogURL string `mapstructure:"schemalog_url" yaml:"schemalog_url"`
}

type KafkaConfig

type KafkaConfig struct {
	Servers       []string            `mapstructure:"servers" yaml:"servers"`
	Topic         TopicConfig         `mapstructure:"topic" yaml:"topic"`
	ConsumerGroup ConsumerGroupConfig `mapstructure:"consumer_group" yaml:"consumer_group"`
	TLS           *TLSConfig          `mapstructure:"tls" yaml:"tls"`
	Backoff       *BackoffConfig      `mapstructure:"backoff" yaml:"backoff"`
}

type KafkaTargetConfig

type KafkaTargetConfig struct {
	Servers []string         `mapstructure:"servers" yaml:"servers"`
	Topic   KafkaTopicConfig `mapstructure:"topic" yaml:"topic"`
	TLS     *TLSConfig       `mapstructure:"tls" yaml:"tls"`
	Batch   *BatchConfig     `mapstructure:"batch" yaml:"batch"`
}

type KafkaTopicConfig

type KafkaTopicConfig struct {
	Name              string `mapstructure:"name" yaml:"name"`
	Partitions        int    `mapstructure:"partitions" yaml:"partitions"`
	ReplicationFactor int    `mapstructure:"replication_factor" yaml:"replication_factor"`
	AutoCreate        bool   `mapstructure:"auto_create" yaml:"auto_create"`
}

type ModifiersConfig

type ModifiersConfig struct {
	Injector        *InjectorConfig        `mapstructure:"injector" yaml:"injector"`
	Transformations *TransformationsConfig `mapstructure:"transformations" yaml:"transformations"`
	Filter          *FilterConfig          `mapstructure:"filter" yaml:"filter"`
}

type PgDumpPgRestoreConfig

type PgDumpPgRestoreConfig struct {
	CleanTargetDB bool `mapstructure:"clean_target_db" yaml:"clean_target_db"`
}

type PostgresConfig

type PostgresConfig struct {
	URL         string             `mapstructure:"url" yaml:"url"`
	Mode        string             `mapstructure:"mode" yaml:"mode"`
	Snapshot    *SnapshotConfig    `mapstructure:"snapshot" yaml:"snapshot"`
	Replication *ReplicationConfig `mapstructure:"replication" yaml:"replication"`
}

type PostgresTargetConfig

type PostgresTargetConfig struct {
	URL               string       `mapstructure:"url" yaml:"url"`
	Batch             *BatchConfig `mapstructure:"batch" yaml:"batch"`
	SchemaLogStoreURL string       `mapstructure:"schema_log_store_url" yaml:"schema_log_store_url"`
	DisableTriggers   bool         `mapstructure:"disable_triggers" yaml:"disable_triggers"`
	OnConflictAction  string       `mapstructure:"on_conflict_action" yaml:"on_conflict_action"`
}

type ReplicationConfig

type ReplicationConfig struct {
	ReplicationSlot string `mapstructure:"replication_slot" yaml:"replication_slot"`
}

type SearchConfig

type SearchConfig struct {
	Engine  string         `mapstructure:"engine" yaml:"engine"`
	URL     string         `mapstructure:"url" yaml:"url"`
	Batch   *BatchConfig   `mapstructure:"batch" yaml:"batch"`
	Backoff *BackoffConfig `mapstructure:"backoff" yaml:"backoff"`
}

type SnapshotConfig

type SnapshotConfig struct {
	Mode            string                  `mapstructure:"mode" yaml:"mode"`
	Tables          []string                `mapstructure:"tables" yaml:"tables"`
	Recorder        *SnapshotRecorderConfig `mapstructure:"recorder" yaml:"recorder"`
	SnapshotWorkers int                     `mapstructure:"snapshot_workers" yaml:"snapshot_workers"`
	Data            *SnapshotDataConfig     `mapstructure:"data" yaml:"data"`
	Schema          *SnapshotSchemaConfig   `mapstructure:"schema" yaml:"schema"`
}

type SnapshotDataConfig

type SnapshotDataConfig struct {
	SchemaWorkers int `mapstructure:"schema_workers" yaml:"schema_workers"`
	TableWorkers  int `mapstructure:"table_workers" yaml:"table_workers"`
	BatchPageSize int `mapstructure:"batch_page_size" yaml:"batch_page_size"`
}

type SnapshotRecorderConfig

type SnapshotRecorderConfig struct {
	RepeatableSnapshots bool   `mapstructure:"repeatable_snapshots" yaml:"repeatable_snapshots"`
	PostgresURL         string `mapstructure:"postgres_url" yaml:"postgres_url"`
}

type SnapshotSchemaConfig

type SnapshotSchemaConfig struct {
	Mode            string                 `mapstructure:"mode" yaml:"mode"`
	PgDumpPgRestore *PgDumpPgRestoreConfig `mapstructure:"pgdump_pgrestore" yaml:"pgdump_pgrestore"`
}

type SourceConfig

type SourceConfig struct {
	Postgres *PostgresConfig `mapstructure:"postgres" yaml:"postgres"`
	Kafka    *KafkaConfig    `mapstructure:"kafka" yaml:"kafka"`
}

type TLSConfig

type TLSConfig struct {
	CACert     string `mapstructure:"ca_cert" yaml:"ca_cert"`
	ClientCert string `mapstructure:"client_cert" yaml:"client_cert"`
	ClientKey  string `mapstructure:"client_key" yaml:"client_key"`
}

type TableTransformersConfig

type TableTransformersConfig struct {
	Schema         string                              `mapstructure:"schema" yaml:"schema"`
	Table          string                              `mapstructure:"table" yaml:"table"`
	ColumnRules    map[string]ColumnTransformersConfig `mapstructure:"column_transformers" yaml:"column_transformers"`
	ValidationMode string                              `mapstructure:"validation_mode" yaml:"validation_mode"`
}

type TargetConfig

type TargetConfig struct {
	Postgres *PostgresTargetConfig `mapstructure:"postgres" yaml:"postgres"`
	Kafka    *KafkaTargetConfig    `mapstructure:"kafka" yaml:"kafka"`
	Search   *SearchConfig         `mapstructure:"search" yaml:"search"`
	Webhooks *WebhooksConfig       `mapstructure:"webhooks" yaml:"webhooks"`
}

type TopicConfig

type TopicConfig struct {
	Name              string `mapstructure:"name" yaml:"name"`
	Partitions        int    `mapstructure:"partitions" yaml:"partitions"`
	ReplicationFactor int    `mapstructure:"replication_factor" yaml:"replication_factor"`
	AutoCreate        bool   `mapstructure:"auto_create" yaml:"auto_create"`
}

type TransformationsConfig

type TransformationsConfig struct {
	TransformerRules []TableTransformersConfig `mapstructure:"table_transformers" yaml:"table_transformers"`
	ValidationMode   string                    `mapstructure:"validation_mode" yaml:"validation_mode"`
}

type WebhookCacheConfig

type WebhookCacheConfig struct {
	Enabled         bool `mapstructure:"enabled" yaml:"enabled"`
	RefreshInterval int  `mapstructure:"refresh_interval" yaml:"refresh_interval"`
}

type WebhookNotifierConfig

type WebhookNotifierConfig struct {
	WorkerCount   int `mapstructure:"worker_count" yaml:"worker_count"`
	ClientTimeout int `mapstructure:"client_timeout" yaml:"client_timeout"`
}

type WebhookServerConfig

type WebhookServerConfig struct {
	Address      string `mapstructure:"address" yaml:"address"`
	ReadTimeout  int    `mapstructure:"read_timeout" yaml:"read_timeout"`
	WriteTimeout int    `mapstructure:"write_timeout" yaml:"write_timeout"`
}

type WebhookStoreConfig

type WebhookStoreConfig struct {
	URL   string              `mapstructure:"url" yaml:"url"`
	Cache *WebhookCacheConfig `mapstructure:"cache" yaml:"cache"`
}

type WebhookSubscriptionsConfig

type WebhookSubscriptionsConfig struct {
	Store  WebhookStoreConfig  `mapstructure:"store" yaml:"store"`
	Server WebhookServerConfig `mapstructure:"server" yaml:"server"`
}

type WebhooksConfig

type WebhooksConfig struct {
	Subscriptions WebhookSubscriptionsConfig `mapstructure:"subscriptions" yaml:"subscriptions"`
	Notifier      WebhookNotifierConfig      `mapstructure:"notifier" yaml:"notifier"`
}

type YAMLConfig

type YAMLConfig struct {
	Source    SourceConfig    `mapstructure:"source" yaml:"source"`
	Target    TargetConfig    `mapstructure:"target" yaml:"target"`
	Modifiers ModifiersConfig `mapstructure:"modifiers" yaml:"modifiers"`
}

Jump to

Keyboard shortcuts

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