A file synchronization library for text files and small binary files (<10MB). Based on Dropbox's streaming file synchronization design.
Add to your Package.swift:
dependencies: [
.package(url: "https://github.com/cooklang/cooklang-sync.git", from: "0.4.1")
]Or in Xcode: File → Add Package Dependencies → enter https://github.com/cooklang/cooklang-sync.git
Add the GitHub Packages repository to settings.gradle.kts:
dependencyResolutionManagement {
repositories {
maven {
url = uri("https://maven.pkg.github.com/cooklang/cooklang-sync")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}
}Add the dependency to build.gradle.kts:
dependencies {
implementation("org.cooklang:cooklang-sync:0.4.4")
}See Mobile SDK Integration Guide for detailed setup instructions.
- Rust (latest stable)
- For iOS builds: Xcode with command-line tools
- For Android builds: Android NDK, cargo-ndk
# Install build dependencies
make install-deps
# Build iOS XCFramework
make ios
# Build Android library
make android
# Build both platforms
make allcargo runcargo run --bin client <sync-directory> <db-path> <server-url> <jwt-token>Example:
cargo run --bin client ../tmp ./db/client.sqlite3 http://localhost:8000 eyXX.XXX.XXXTest tokens can be generated at https://jwt.io with:
- Secret:
secret - Payload:
{
"uid": 100,
"exp": 1720260223
}The library consists of two main components:
- Server (
cooklang-sync-server): Handles file synchronization requests - Client (
cooklang-sync-client): Provides sync capabilities with FFI bindings for iOS and Android
- Garbage collection for client
- Comprehensive test suite
- Generalize for broader use cases
- Read-only file support
- Metrics export
- Security audit
- Symlink support
- Hidden file handling
MPL-2.0