breaksync

package
v4.49.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Identity = func(a string) string {
	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(string) string) *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) string, readRupture *Rupture) *Source[T]

func NewSliceSource added in v4.13.0

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

func NewSource

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

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

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

func (*Source[T]) Current

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

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

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

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() string

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() string
	NextKey() string
	IsSynchronized() bool
	ComputeSynchro(string)
	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