sqlite

package
v0.0.0-...-0d745bf Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package sqlite provides the default SQLite-backed persistence implementation for the BitBoxSync sync engine.

Index

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 Open

func Open(path string) (*Store, error)

Open opens or creates a SQLite-backed sync store at path.

func OpenInMemory

func OpenInMemory() (*Store, error)

OpenInMemory opens an in-memory SQLite-backed sync store.

func (*Store) Close

func (s *Store) Close() error

Close releases the underlying SQLite database handle.

func (*Store) ForgetIdentitySecrets

func (s *Store) ForgetIdentitySecrets(ctx context.Context, keyID string) error

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

func (s *Store) ResetSyncState(ctx context.Context, keyID string) error

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

func (s *Store) SaveItem(ctx context.Context, state bitboxsync.ItemState) error

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.

Jump to

Keyboard shortcuts

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