Documentation
¶
Overview ¶
Package sqlite provides the default SQLite-backed persistence implementation for the BitBoxSync sync engine.
Index ¶
- type Store
- func (s *Store) Close() error
- func (s *Store) ForgetIdentitySecrets(ctx context.Context, keyID string) error
- func (s *Store) GetItemByID(ctx context.Context, keyID, namespaceID, itemID string) (bitboxsync.ItemState, error)
- func (s *Store) GetItemByLogicalKey(ctx context.Context, keyID, namespaceID, collection, key string) (bitboxsync.ItemState, error)
- func (s *Store) GetNamespace(ctx context.Context, keyID, namespaceID string) (bitboxsync.NamespaceState, error)
- func (s *Store) ListDirtyItems(ctx context.Context, keyID string) (items []bitboxsync.ItemState, err error)
- func (s *Store) ListNamespaceItems(ctx context.Context, keyID, namespaceID string) (items []bitboxsync.ItemState, err error)
- func (s *Store) ListNamespaces(ctx context.Context, keyID string) (states []bitboxsync.NamespaceState, err error)
- func (s *Store) LoadIdentity(ctx context.Context, keyID string) (bitboxsync.IdentityState, error)
- func (s *Store) ResetSyncState(ctx context.Context, keyID string) error
- func (s *Store) SaveIdentity(ctx context.Context, state bitboxsync.IdentityState) error
- func (s *Store) SaveItem(ctx context.Context, state bitboxsync.ItemState) error
- func (s *Store) SaveNamespace(ctx context.Context, state bitboxsync.NamespaceState) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the default SQLite-backed implementation of the bitboxsync.Store interface.
func OpenInMemory ¶
OpenInMemory opens an in-memory SQLite-backed sync store.
func (*Store) ForgetIdentitySecrets ¶
ForgetIdentitySecrets clears locally cached secrets for one identity while preserving namespace and item metadata for future merge reconciliation.
func (*Store) GetItemByID ¶
func (s *Store) GetItemByID(ctx context.Context, keyID, namespaceID, itemID string) (bitboxsync.ItemState, error)
GetItemByID loads one cached item by its opaque item ID.
func (*Store) GetItemByLogicalKey ¶
func (s *Store) GetItemByLogicalKey(ctx context.Context, keyID, namespaceID, collection, key string) (bitboxsync.ItemState, error)
GetItemByLogicalKey loads one cached item by collection name and logical key.
func (*Store) GetNamespace ¶
func (s *Store) GetNamespace(ctx context.Context, keyID, namespaceID string) (bitboxsync.NamespaceState, error)
GetNamespace loads cached namespace metadata for one device identity.
func (*Store) ListDirtyItems ¶
func (s *Store) ListDirtyItems(ctx context.Context, keyID string) (items []bitboxsync.ItemState, err error)
ListDirtyItems returns cached items with unapplied local changes.
func (*Store) ListNamespaceItems ¶
func (s *Store) ListNamespaceItems(ctx context.Context, keyID, namespaceID string) (items []bitboxsync.ItemState, err error)
ListNamespaceItems returns all cached items for a namespace.
func (*Store) ListNamespaces ¶
func (s *Store) ListNamespaces(ctx context.Context, keyID string) (states []bitboxsync.NamespaceState, err error)
ListNamespaces returns all namespaces cached for one device identity.
func (*Store) LoadIdentity ¶
func (s *Store) LoadIdentity(ctx context.Context, keyID string) (bitboxsync.IdentityState, error)
LoadIdentity loads persisted auth/session state for one device identity.
func (*Store) ResetSyncState ¶
ResetSyncState clears cached sync metadata while preserving auth/session state so the next sync can bootstrap from the server again.
func (*Store) SaveIdentity ¶
func (s *Store) SaveIdentity(ctx context.Context, state bitboxsync.IdentityState) error
SaveIdentity upserts persisted auth/session state for one device identity.
func (*Store) SaveItem ¶
SaveItem upserts the cached state for one item, including conflict metadata.
func (*Store) SaveNamespace ¶
func (s *Store) SaveNamespace(ctx context.Context, state bitboxsync.NamespaceState) error
SaveNamespace upserts cached namespace metadata and secrets.