breaksync

package
v4.78.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Identity = func(a string) []byte {
	return []byte(a)
}
View Source
var RuptureIdentity = func(a []byte) []byte {
	return a
}

Functions

This section is empty.

Types

type Rupture

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

func NewRupture

func NewRupture(name string, extract func([]byte) []byte) *Rupture

type Source

type Source[T any] struct {
	// contains filtered or unexported fields
}

func NewChanSource added in v4.39.0

func NewChanSource[T any](input <-chan T, keyer func(T) []byte, readRupture *Rupture) *Source[T]

func NewSliceSource added in v4.13.0

func NewSliceSource[T any](arr []T, keyer func(T) []byte, readRupture *Rupture) *Source[T]

func NewSource

func NewSource[T any](reader func() (T, error), keyer func(T) []byte, readRupture *Rupture) *Source[T]

func (*Source[T]) ComputeSynchro added in v4.39.0

func (s *Source[T]) ComputeSynchro(key []byte)

func (*Source[T]) Current

func (s *Source[T]) Current() any

func (*Source[T]) CurrentKey added in v4.39.0

func (s *Source[T]) CurrentKey() []byte

func (*Source[T]) IsSynchronized added in v4.39.0

func (s *Source[T]) IsSynchronized() bool

func (*Source[T]) NextKey added in v4.39.0

func (s *Source[T]) NextKey() []byte

func (*Source[T]) Read added in v4.39.0

func (s *Source[T]) Read() error

func (*Source[T]) ReadRupture added in v4.39.0

func (s *Source[T]) ReadRupture() *Rupture

type SyncSource added in v4.39.0

type SyncSource interface {
	ReadRupture() *Rupture
	Current() any
	CurrentKey() []byte
	NextKey() []byte
	IsSynchronized() bool
	ComputeSynchro([]byte)
	Read() error
}

type Synchronization

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

func NewSynchronization

func NewSynchronization() *Synchronization

func (*Synchronization) AddSources added in v4.13.0

func (s *Synchronization) AddSources(sources ...SyncSource) *Synchronization

func (*Synchronization) Run

func (s *Synchronization) Run(business func(uint64, []any) error) (err error)

Jump to

Keyboard shortcuts

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