datastoretest

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(dynamo *datastore.Dynamo) error

CreateTable creates datastore.Table in dynamoDB.

func DeleteTable

func DeleteTable(dynamo *datastore.Dynamo) error

DeleteTable deletes datastore.Table in dynamoDB.

func ResetTable

func ResetTable(dynamo *datastore.Dynamo) error

ResetTable deletes and creates datastore.Table in dynamoDB.

func ScanClientItemCounts

func ScanClientItemCounts(dynamo *datastore.Dynamo) ([]datastore.ClientItemCount, error)

ScanClientItemCounts scans the dynamoDB table and returns all client item counts.

func ScanSyncEntities

func ScanSyncEntities(dynamo *datastore.Dynamo) ([]datastore.SyncEntity, error)

ScanSyncEntities scans the dynamoDB table and returns all sync items.

func ScanTagItems

func ScanTagItems(dynamo *datastore.Dynamo) ([]datastore.ServerClientUniqueTagItem, error)

ScanTagItems scans the dynamoDB table and returns all tag items.

Types

type MockDatastore added in v0.1.20

type MockDatastore struct {
	mock.Mock
}

MockDatastore is used to mock datastorein tests

func (*MockDatastore) ClearServerData added in v0.1.20

func (m *MockDatastore) ClearServerData(clientID string) ([]datastore.SyncEntity, error)

ClearServerData mocks calls to ClearServerData

func (*MockDatastore) DisableSyncChain added in v0.1.20

func (m *MockDatastore) DisableSyncChain(clientID string) error

DisableSyncChain mocks calls to DisableSyncChain

func (*MockDatastore) GetClientItemCount added in v0.1.20

func (m *MockDatastore) GetClientItemCount(clientID string) (int, error)

GetClientItemCount mocks calls to GetClientItemCount

func (*MockDatastore) GetUpdatesForType added in v0.1.20

func (m *MockDatastore) GetUpdatesForType(dataType int, clientToken int64, fetchFolders bool, clientID string, maxSize int64) (bool, []datastore.SyncEntity, error)

GetUpdatesForType mocks calls to GetUpdatesForType

func (*MockDatastore) HasServerDefinedUniqueTag added in v0.1.20

func (m *MockDatastore) HasServerDefinedUniqueTag(clientID string, tag string) (bool, error)

HasServerDefinedUniqueTag mocks calls to HasServerDefinedUniqueTag

func (*MockDatastore) InsertSyncEntitiesWithServerTags added in v0.1.20

func (m *MockDatastore) InsertSyncEntitiesWithServerTags(entities []*datastore.SyncEntity) error

InsertSyncEntitiesWithServerTags mocks calls to InsertSyncEntitiesWithServerTags

func (*MockDatastore) InsertSyncEntity added in v0.1.20

func (m *MockDatastore) InsertSyncEntity(entity *datastore.SyncEntity) (bool, error)

InsertSyncEntity mocks calls to InsertSyncEntity

func (*MockDatastore) IsSyncChainDisabled added in v0.1.20

func (m *MockDatastore) IsSyncChainDisabled(clientID string) (bool, error)

IsSyncChainDisabled mocks calls to IsSyncChainDisabled

func (*MockDatastore) UpdateClientItemCount added in v0.1.20

func (m *MockDatastore) UpdateClientItemCount(clientID string, count int) error

UpdateClientItemCount mocks calls to UpdateClientItemCount

func (*MockDatastore) UpdateSyncEntity added in v0.1.20

func (m *MockDatastore) UpdateSyncEntity(entity *datastore.SyncEntity, oldVersion int64) (conflict bool, delete bool, err error)

UpdateSyncEntity mocks calls to UpdateSyncEntity

Jump to

Keyboard shortcuts

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