mylogical

package
v0.0.0-...-4dcfcdd Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

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

Set is used by Wire.

Functions

This section is empty.

Types

type Config

type Config struct {
	DLQ       dlq.Config
	Script    script.Config
	Sequencer sequencer.Config
	Staging   sinkprod.StagingConfig
	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.

func (*Config) Bind

func (c *Config) Bind(f *pflag.FlagSet)

Bind adds flags to the set. It delegates to the embedded Config.Bind.

func (*Config) Preflight

func (c *Config) Preflight() error

Preflight updates the configuration with sane defaults or returns an error if there are missing options for which a default cannot be provided.

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

func Start(ctx *stopper.Context, config *Config) (*MYLogical, error)

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.

Jump to

Keyboard shortcuts

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