Clarification of the framework #144
-
|
Can someone clarify the structure of the underlying syncthing implementation for me? I was reading that go doesn't compile to libraries very well (Im presuming from these comments that maybe it doesn't do CAPI?) and that this project has a go-swift bridge. Getting to my point... if this core IS an actual library and not just IPC to a process, maybe it would be beneficial to spin the core -> xcframework into a seperate repository that just provides a swift package? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
This is covered quite well in Tommy's blog post announcing the project: https://t-shaped.nl/posts/synctrain-a-rethought-ios-client-for-syncthing (While I'm here - thank you so much for making synctrain - it was the missing piece in making iOS tolerable for me!) |
Beta Was this translation helpful? Give feedback.
-
|
Okay, if I understand that blog correctly then (it's all high level...) it's using bits of syncthing's core code for some standardised bevhaiour...
But then as it mentions parsing protobuf, I guess this implementation is handling the protocol in swift. So I guess this framework is running the node, rather than using the core/go code to run a node (and thus skipping all the file system stuff) |
Beta Was this translation helpful? Give feedback.
The app is written in Swift and that is the entry point for it. The app relies on a library (
SushitrainCore.xcframework) that is built from Go code usinggomobile. This Go code imports Syncthing packages, so effectively thexcframeworklibrary contains all of Syncthing. The framework additionally contains various 'glue functions' and e.g. the streaming server.On startup, the Swift side calls into the (Go) framework, which calls into the Syncthing packages. Roughly speaking at startup it does all the things the
mainfunction of the regular Syncthing binary will do to start up a full Syncthing node (in the current process, so not forking or spawning a separate one).We are not doing any pr…