Documentation
¶
Index ¶
- type CDCConfig
- type CDCFactory
- type CDCSource
- func (c *CDCSource) GetMetadata() adapters.SourceMetadata
- func (c *CDCSource) GetSourceSchema() *adapters.Schema
- func (c *CDCSource) HealthCheck() error
- func (c *CDCSource) Start(ctx context.Context) error
- func (c *CDCSource) Stop(ctx context.Context) error
- func (c *CDCSource) Subscribe(ctx context.Context, factTypes []string) (<-chan *adapters.TypedFact, error)
- type ChangeEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CDCConfig ¶
type CDCConfig struct {
SourceID string `json:"source_id" yaml:"source_id"`
Host string `json:"host" yaml:"host"`
Port int `json:"port" yaml:"port"`
User string `json:"user" yaml:"user"`
Password string `json:"password" yaml:"password"`
Flavor string `json:"flavor" yaml:"flavor"` // mysql or mariadb
ServerID uint32 `json:"server_id" yaml:"server_id"`
Database string `json:"database" yaml:"database"`
Tables []string `json:"tables" yaml:"tables"`
Operations []string `json:"operations" yaml:"operations"`
SchemaMapping map[string]string `json:"schema_mapping" yaml:"schema_mapping"`
StartFile string `json:"start_file" yaml:"start_file"`
StartPos uint32 `json:"start_pos" yaml:"start_pos"`
GTID string `json:"gtid" yaml:"gtid"`
CheckpointPath string `json:"checkpoint_path" yaml:"checkpoint_path"`
DSN string `json:"dsn" yaml:"dsn"`
BufferSize int `json:"buffer_size" yaml:"buffer_size"`
Timeout time.Duration `json:"timeout" yaml:"timeout"`
}
CDCConfig holds MySQL CDC configuration.
type CDCFactory ¶
type CDCFactory struct{}
Factory for MySQL CDC sources.
func (*CDCFactory) Create ¶
func (f *CDCFactory) Create(config adapters.SourceConfig) (adapters.FactSource, error)
func (*CDCFactory) GetConfigSchema ¶
func (f *CDCFactory) GetConfigSchema() adapters.ConfigSchema
func (*CDCFactory) ValidateConfig ¶
func (f *CDCFactory) ValidateConfig(config adapters.SourceConfig) error
type CDCSource ¶
type CDCSource struct {
// contains filtered or unexported fields
}
CDCSource implements MySQL binlog streaming.
func NewCDCSource ¶
NewCDCSource creates a new MySQL CDC source.
func (*CDCSource) GetMetadata ¶
func (c *CDCSource) GetMetadata() adapters.SourceMetadata
GetMetadata returns source metadata.
func (*CDCSource) GetSourceSchema ¶
GetSourceSchema returns schema metadata.
func (*CDCSource) HealthCheck ¶
HealthCheck checks connectivity.
type ChangeEvent ¶
type ChangeEvent struct {
Operation string `json:"operation"`
Schema string `json:"schema"`
Table string `json:"table"`
Before map[string]interface{} `json:"before,omitempty"`
After map[string]interface{} `json:"after,omitempty"`
Binlog string `json:"binlog"`
Pos uint32 `json:"pos"`
Timestamp time.Time `json:"timestamp"`
}
ChangeEvent represents a MySQL change event.
Click to show internal directories.
Click to hide internal directories.