gokrazy / rsync

gokrazy rsync
BSD 3-Clause "New" or "Revised" License
494 stars 28 forks source link

Enable use as a library #12

Closed joonas-fi closed 2 years ago

joonas-fi commented 2 years ago

It would be great to use rsync server as a library in other Go projects.

stapelberg commented 2 years ago

Is this done with https://github.com/gokrazy/rsync/pull/11, or is there anything else you’re planning on doing before this issue should be closed? :)

joonas-fi commented 2 years ago

Great question!

How about docs, should we just link to the PR for the code example? I have nothing else in mind. (That reminds me, the code example is outdated w.r.t. the module slice. I'll update it when I get back home.)

stapelberg commented 2 years ago

Or maybe we add a minimal server example? Should only be a few lines of code :)

joonas-fi commented 2 years ago

In README.md or as an example binary under cmd/?

stapelberg commented 2 years ago

Ideally as a testable example that shows up in godoc and is verified to compile using go test: https://go.dev/blog/examples :)

joonas-fi commented 2 years ago

lol thank you, once again I'm learning from you, I've spat out Go code for years but never learned about "testable examples" :smile: