common

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncSubject

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

SyncSubject defines information about entities to be synchronized.

func NewSyncSubject

func NewSyncSubject(factoryFunc contracts.EntityFactoryFunc) *SyncSubject

NewSyncSubject returns a new SyncSubject.

func (SyncSubject) Entity

func (s SyncSubject) Entity() contracts.Entity

Entity returns one value from the factory. Always returns the same entity.

func (SyncSubject) Factory

Factory returns the entity factory function that calls Init() on the created contracts.Entity if applicable.

func (SyncSubject) FactoryForDelta added in v1.1.0

func (s SyncSubject) FactoryForDelta() contracts.EntityFactoryFunc

FactoryForDelta behaves like Factory() unless s is WithChecksum(). In the latter case it returns a factory for EntityWithChecksum instead. Rationale: Sync#ApplyDelta() uses its input entities which are WithChecksum() only for the delta itself and not for insertion into the database, so EntityWithChecksum is enough. And it consumes less memory.

func (SyncSubject) Name

func (s SyncSubject) Name() string

Name returns the declared name of the entity.

func (SyncSubject) WithChecksum

func (s SyncSubject) WithChecksum() bool

WithChecksum returns whether entities from the factory implement contracts.Checksumer.

Jump to

Keyboard shortcuts

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