Documentation ¶
Index ¶
- Constants
- func GetAllDataFromBucket[T persist.MarshallableItem](s *DbItemSyncer) ([]persist.MarshallableItem, error)
- type DbItemSyncer
- func (s *DbItemSyncer) Count() int
- func (s *DbItemSyncer) CountDeletes() int
- func (s *DbItemSyncer) Delete(item persist.MarshallableItem) error
- func (s *DbItemSyncer) LoadAll() ([]persist.MarshallableItem, error)
- func (s *DbItemSyncer) LoadByID(id string) (persist.MarshallableItem, error)
- func (s *DbItemSyncer) Write(item persist.MarshallableItem) error
Constants ¶
View Source
const ( MessageSyncer int = 0 EventSyncer = 1 PatientSyncer = 2 )
Variables ¶
This section is empty.
Functions ¶
func GetAllDataFromBucket ¶
func GetAllDataFromBucket[T persist.MarshallableItem](s *DbItemSyncer) ([]persist.MarshallableItem, error)
Types ¶
type DbItemSyncer ¶
type DbItemSyncer struct {
// contains filtered or unexported fields
}
ItemSyncer implements the persist.ItemSyncer interface using a map. It tracks the LoadByID requests made to the syncer in the form of an internal `reqs` map for testing purposes.
func NewItemSyncer ¶
func NewItemSyncer(syncType int) *DbItemSyncer
NewItemSyncer initializes the ItemSyncer.
func NewItemSyncerWithDelete ¶
func NewItemSyncerWithDelete(syncType int, delete bool) *DbItemSyncer
NewItemSyncerWithDelete initializes the ItemSyncer with a value for whether to delete items or not.
func (*DbItemSyncer) Count ¶
func (s *DbItemSyncer) Count() int
Count returns number of elements in the syncer for testing.
func (*DbItemSyncer) CountDeletes ¶
func (s *DbItemSyncer) CountDeletes() int
CountDeletes returns the number of deletions requested.
func (*DbItemSyncer) Delete ¶
func (s *DbItemSyncer) Delete(item persist.MarshallableItem) error
Delete deletes an item from the map.
func (*DbItemSyncer) LoadAll ¶
func (s *DbItemSyncer) LoadAll() ([]persist.MarshallableItem, error)
LoadAll returns a slice of all the items in the map, sorted by id.
func (*DbItemSyncer) LoadByID ¶
func (s *DbItemSyncer) LoadByID(id string) (persist.MarshallableItem, error)
LoadByID returns an item in the map with the provided id, if it exists.
func (*DbItemSyncer) Write ¶
func (s *DbItemSyncer) Write(item persist.MarshallableItem) error
Write writes an item to the map.
Click to show internal directories.
Click to hide internal directories.