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 database.EntityFactoryFunc) *SyncSubject
NewSyncSubject returns a new SyncSubject.
func (SyncSubject) Entity ¶
func (s SyncSubject) Entity() database.Entity
Entity returns one value from the factory. Always returns the same entity.
func (SyncSubject) Factory ¶
func (s SyncSubject) Factory() database.EntityFactoryFunc
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() database.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.