base

package
v0.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataObjectsToTableParts

func DataObjectsToTableParts(objects DataObjects, filter DataObjectFilter) ([]abstract.TableDescription, error)

func EventToString

func EventToString(event Event) string

Types

type Column

type Column interface {
	Table() Table
	Name() string
	FullName() string
	// TODO: Equals(otherColumn Column) bool ?
	Type() Type
	Value(val interface{}) (Value, error)
	Nullable() bool
	Key() bool

	// Support legacy
	ToOldColumn() (*abstract.ColSchema, error)
}

type DataObject

type DataObject interface {
	Name() string
	FullName() string

	// Iterator
	Next() bool
	Err() error
	Close()
	Part() (DataObjectPart, error)

	// Support legacy
	ToOldTableID() (*abstract.TableID, error)
}

type DataObjectFilter

type DataObjectFilter interface {
	Includes(obj DataObject) (bool, error)
	IncludesID(tID abstract.TableID) (bool, error)
}

type DataObjectPart

type DataObjectPart interface {
	Name() string
	FullName() string

	// Support legacy
	ToOldTableDescription() (*abstract.TableDescription, error)

	// Support new snapshot
	ToTablePart() (*abstract.TableDescription, error)
}

type DataObjects

type DataObjects interface {
	// Iterator
	Next() bool
	Err() error
	Close()
	Object() (DataObject, error)

	// Support legacy
	ToOldTableMap() (abstract.TableMap, error)
}

type DataProvider

type DataProvider interface {
	Init() error
	Ping() error
	Close() error
}

type DefaultEventSourceProgress

type DefaultEventSourceProgress struct {
	// contains filtered or unexported fields
}

func NewDefaultEventSourceProgress

func NewDefaultEventSourceProgress(done bool, current uint64, total uint64) *DefaultEventSourceProgress

func (*DefaultEventSourceProgress) Current

func (progress *DefaultEventSourceProgress) Current() uint64

func (*DefaultEventSourceProgress) Done

func (progress *DefaultEventSourceProgress) Done() bool

func (*DefaultEventSourceProgress) Total

func (progress *DefaultEventSourceProgress) Total() uint64

type Discoverable

type Discoverable interface {
	Discover() (*model.DataObjects, error)
}

type Event

type Event interface {
}

type EventBatch

type EventBatch interface {
	Next() bool
	Event() (Event, error)
	Count() int
	Size() int
}

func NewBatchFromBatches

func NewBatchFromBatches(batches []EventBatch) EventBatch

func NewEventBatch

func NewEventBatch(events []Event) EventBatch

func NewSingleEventBatch

func NewSingleEventBatch(event Event) EventBatch

type EventSource

type EventSource interface {
	Running() bool
	Start(ctx context.Context, target EventTarget) error
	Stop() error
}

For any event source, replication, snapshot, etc

type EventSourceProgress

type EventSourceProgress interface {
	Done() bool
	Current() uint64
	Total() uint64
}

type EventTarget

type EventTarget interface {
	io.Closer
	AsyncPush(input EventBatch) chan error
}

abstract.AsyncSink for abstract2

type LogPosition

type LogPosition interface {
	fmt.Stringer
	Equals(otherPosition LogPosition) bool
	Compare(otherPosition LogPosition) (int, error)
}

type LoggedEvent

type LoggedEvent interface {
	Event
	Position() LogPosition
}

type ProgressableEventSource

type ProgressableEventSource interface {
	EventSource
	Progress() (EventSourceProgress, error)
}

Reporting of progress for not endless event sources Like snapshots, schema creation, etc

type ReplicationProvider

type ReplicationProvider interface {
	DataProvider
	CreateReplicationSource() (EventSource, error)
}

type SnapshotProvider

type SnapshotProvider interface {
	DataProvider
	BeginSnapshot() error
	DataObjects(filter DataObjectFilter) (DataObjects, error)
	TableSchema(part DataObjectPart) (*abstract.TableSchema, error)
	CreateSnapshotSource(part DataObjectPart) (ProgressableEventSource, error)
	EndSnapshot() error

	// Support legacy
	ResolveOldTableDescriptionToDataPart(tableDesc abstract.TableDescription) (DataObjectPart, error)

	// Support new snapshot
	DataObjectsToTableParts(filter DataObjectFilter) ([]abstract.TableDescription, error)
	TablePartToDataObjectPart(tableDescription *abstract.TableDescription) (DataObjectPart, error)
}

type SupportsOldChangeItem

type SupportsOldChangeItem interface {
	Event
	ToOldChangeItem() (*abstract.ChangeItem, error)
}

Support legacy

type SupportsOldCommitTime

type SupportsOldCommitTime interface {
	LogPosition
	ToOldCommitTime() (uint64, error) // To ChangeItem.CommitTime
}

Support legacy

type SupportsOldLSN

type SupportsOldLSN interface {
	LogPosition
	ToOldLSN() (uint64, error) // To ChangeItem.LSN
}

Support legacy

type Table

type Table interface {
	Database() string
	Schema() string
	Name() string
	FullName() string
	// TODO: Equals(otherTable Table) bool ?
	ColumnsCount() int
	Column(i int) Column
	ColumnByName(name string) Column

	// Support legacy
	ToOldTable() (*abstract.TableSchema, error)
}

type TrackerProvider

type TrackerProvider interface {
	DataProvider
	ResetTracker(typ abstract.TransferType) error
}

type Transaction

type Transaction interface {
	fmt.Stringer
	BeginPosition() LogPosition
	EndPosition() LogPosition
	Equals(otherTransaction Transaction) bool
}

type TransactionalEvent

type TransactionalEvent interface {
	LoggedEvent
	Transaction() Transaction
}

type Type

type Type interface {
	// TODO: Equals(otherType Type) bool ?
	Validate(value Value) error

	// Support legacy
	ToOldType() (yt_schema.Type, error)
}

TODO: this interface should be sealed.

type Value

type Value interface {
	Column() Column
	// TODO: Equals(otherValue Value) bool ?
	Value() interface{}

	// Support legacy
	ToOldValue() (interface{}, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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