Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface {
Store(ctx context.Context, sync *domain.Sync) (*domain.Sync, error)
Delete(ctx context.Context, id int) error
Update(ctx context.Context, sync *domain.Sync) (*domain.Sync, error)
ListSyncs(ctx context.Context, apiKey string) ([]domain.Sync, error)
GetSyncByApiKey(ctx context.Context, apiKey string) (*domain.Sync, error)
GetSyncData(ctx context.Context, apiKey string) (*domain.SyncData, error)
SyncData(ctx context.Context, sync *domain.SyncData) (*domain.SyncData, error)
GetSyncLockFile(ctx context.Context, apiKey string) (*domain.SyncLockFile, error)
CreateSyncLockFile(ctx context.Context, apiKey string, acquiredBy string) (*domain.SyncLockFile, error)
UpdateSyncLockFile(ctx context.Context, syncLockFile *domain.SyncLockFile) (*domain.SyncLockFile, error)
DeleteSyncLockFile(ctx context.Context, apiKey string) bool
// Get etag of sync data.
// For avoid memory usage, only the etag will be returned.
GetSyncDataETag(ctx context.Context, apiKey string) (*string, error)
// Get sync data and etag
GetSyncDataAndETag(ctx context.Context, apiKey string) ([]byte, *string, error)
// Create or replace sync data, returns the new etag.
SetSyncData(ctx context.Context, apiKey string, data []byte) (*string, error)
// Replace sync data only if the etag matches,
// returns the new etag if updated, or nil if not.
SetSyncDataIfMatch(ctx context.Context, apiKey string, etag string, data []byte) (*string, error)
}
Click to show internal directories.
Click to hide internal directories.