Expand description
gRPC sync client for communicating with snip-sync server.
Handles bidirectional synchronization of snippets with encryption in transit. Uses TLS for secure communication and AES-256-GCM for snippet encryption.
§Sync Flow
- Connect to server with TLS
- Encrypt local snippets with user’s API key
- Send encrypted snippets with last sync timestamp
- Receive encrypted remote snippets
- Decrypt and merge with local storage
Structs§
- Sync
Client - Client for syncing snippets with a remote server.
- Sync
Retry Config - Configuration for gRPC retry behavior with exponential backoff.
Functions§
- decrypt_
snippet - Decrypts a snippet’s encrypted fields received from the sync server.
- detect_
device_ conflict - Detects if any server snippets have a device_id that doesn’t match the expected local device_id, indicating a potential conflict from another device.
- encrypt_
snippet - Encrypts a snippet’s sensitive fields (description, command, tags) for sync.