Documentation
¶
Overview ¶
Package mylogical contains support for reading a mySQL logical replication feed. It uses Replication with Global Transaction Identifiers. See https://dev.mysql.com/doc/refman/8.0/en/replication-gtids.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Set = wire.NewSet( ProvideConn, ProvideEagerConfig, ProvideSchemaWatchConfig, )
Set is used by Wire.
Functions ¶
func ProvideSchemaWatchConfig ¶ added in v1.0.5
func ProvideSchemaWatchConfig(cfg *Config) *schemawatch.Config
ProvideSchemaWatchConfig is called by Wire.
Types ¶
type Config ¶
type Config struct {
DLQ dlq.Config
SchemaWatch schemawatch.Config
Script script.Config
Sequencer sequencer.Config
Stage stage.Config // Staging table configuration.
Staging sinkprod.StagingConfig // Staging database configuration.
Target sinkprod.TargetConfig
InitialGTID string
FetchMetadata bool
SourceConn string // Connection string for the source db.
ProcessID uint32 // A unique ID to identify this process to the master.
// The SQL schema in the target cluster to write into. This value is
// optional if a userscript dispatch function is present.
TargetSchema ident.Schema
// contains filtered or unexported fields
}
Config contains the configuration necessary for creating a replication connection. ServerID and SourceConn are mandatory.
type Conn ¶
type Conn conn
Conn exports the package-internal type.
func ProvideConn ¶
func ProvideConn( ctx *stopper.Context, acc *apply.Acceptor, chaos *chaos.Chaos, config *Config, imm *immediate.Immediate, memo types.Memo, scriptSeq *scriptSeq.Sequencer, stagingPool *types.StagingPool, targetPool *types.TargetPool, watchers types.Watchers, ) (*Conn, error)
ProvideConn is called by Wire to construct this package's logical.Dialect implementation. There's a fake dependency on the script loader so that flags can be evaluated first.
type EagerConfig ¶
type EagerConfig Config
EagerConfig is a hack to get Wire to move userscript evaluation to the beginning of the injector. This allows CLI flags to be set by the script.
func ProvideEagerConfig ¶
func ProvideEagerConfig(cfg *Config, _ *script.Loader) (*EagerConfig, error)
ProvideEagerConfig is a hack to move up the evaluation of the user script so that the options callbacks can set any non-script-related CLI flags. The configuration will be preflighted.
type MYLogical ¶
type MYLogical struct {
Conn *Conn
Diagnostics *diag.Diagnostics
}
MYLogical is a MySQL/MariaDB logical replication loop.
func Start ¶
Start creates a MySQL/MariaDB logical replication loop using the provided configuration.
func (*MYLogical) GetDiagnostics ¶
func (l *MYLogical) GetDiagnostics() *diag.Diagnostics
GetDiagnostics implements stdlogical.HasDiagnostics.