Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteElement ¶
func DeleteElement[E comparable](es []E, element E) []E
DeleteElement removes a specified element from a slice while maintaining the order of the slice
func DeleteElements ¶
func DeleteElements[E comparable](es []E, toDelete []E) []E
DeleteElements removes elements from a slice that are contained in another slice, while maintaining the order of the slice
Types ¶
type VersionSynchronizer ¶
type VersionSynchronizer[V, R any] struct { Ctx context.Context DB db_interface.VersionSyncModel TableName string EntityID string Key func(V) string Local func() ([]V, error) ServerVersion func() R Server func(version *model_struct.LocalVersionSync) (R, error) Full func(resp R) bool Version func(resp R) (string, uint64) Delete func(resp R) []string Update func(resp R) []V Insert func(resp R) []V ExtraData func(resp R) any ExtraDataProcessor func(ctx context.Context, data any) error Syncer func(server, local []V) error FullSyncer func(ctx context.Context) error FullID func(ctx context.Context) ([]string, error) IDOrderChanged func(resp R) bool }
func (*VersionSynchronizer[V, R]) CheckVersionSync ¶
func (o *VersionSynchronizer[V, R]) CheckVersionSync() error
func (*VersionSynchronizer[V, R]) Sync ¶
func (o *VersionSynchronizer[V, R]) Sync() error
Click to show internal directories.
Click to hide internal directories.