driver

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(engine string, factory Factory)

Types

type BackupOptions

type BackupOptions struct {
	Database string
	Output   io.Writer
}

type BackupResult

type BackupResult struct {
	BytesWritten int64
}

type Backuper

type Backuper interface {
	Backup(ctx context.Context, opts BackupOptions) (BackupResult, error)
	SupportsIncremental() bool
	SupportsDifferential() bool
	IncrementalBasis() IncrementalBasisKind
}

type ConnectionConfig

type ConnectionConfig struct {
	Host     string
	Port     int
	User     string
	Password string
	Database string
	Extra    map[string]string
}

type Connector

type Connector interface {
	Connect(ctx context.Context, cfg ConnectionConfig) error
	Ping(ctx context.Context) error
	Close() error
}

type Factory

type Factory func(cfg ConnectionConfig) (Connector, Backuper, Restorer)

func Get

func Get(engine string) (Factory, bool)

type IncrementalBasisKind

type IncrementalBasisKind int

IncrementalBasisKind names what an incremental backup for a given engine is anchored to.

const (
	BasisNone IncrementalBasisKind = iota
	BasisBinlog
	BasisWAL
	BasisOplog
)

func (IncrementalBasisKind) String

func (k IncrementalBasisKind) String() string

type RestoreOptions

type RestoreOptions struct {
	Database string
	Input    io.Reader
}

type Restorer

type Restorer interface {
	Restore(ctx context.Context, opts RestoreOptions) error
	SupportsSelective() bool
}

Jump to

Keyboard shortcuts

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