snapshot

package
v0.0.0-...-ab40c3c Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Plugins contains registered snaphot reader plugins

Functions

This section is empty.

Types

type Reader

type Reader interface {
	//Start connects to the db and starts snapshot for the table
	Start(cluster string, svc string, dbs string, table string, enc encoder.Encoder) (lastGtid string, err error)
	//End deinitializes snapshot reader
	End()

	//FIXME: FromTx methods used in validation code only, look for a way to
	//remove it from this generic
	//StartFromTx starts snapshot from given tx
	StartFromTx(svc string, dbs string, table string, enc encoder.Encoder, tx *sql.Tx) (lastGtid string, err error)
	//EndFromTx deinitializes reader started by PrepareFromTx
	EndFromTx()

	//GetNext pops record fetched by HasNext
	//returns: key and encoded message
	GetNext() (string, []byte, error)

	//HasNext fetches the record from the source and encodes using encoder provided when reader created
	//This is a blocking method
	HasNext() bool
}

Reader is our contract for snapshot reader

func InitReader

func InitReader(input string) (Reader, error)

InitReader constructs encoder without updating schema

type ReaderConstructor

type ReaderConstructor func() (Reader, error)

ReaderConstructor initializes logger plugin

Jump to

Keyboard shortcuts

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