Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vole/btsync-api
Go client for the Bittorrent Sync API
https://github.com/vole/btsync-api
Last synced: about 2 months ago
JSON representation
Go client for the Bittorrent Sync API
- Host: GitHub
- URL: https://github.com/vole/btsync-api
- Owner: vole
- License: mit
- Created: 2013-10-28T05:44:43.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-08T20:56:09.000Z (over 10 years ago)
- Last Synced: 2024-07-20T03:19:02.162Z (2 months ago)
- Language: Go
- Size: 150 KB
- Stars: 27
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BTSync API
Golang client for the Bittorrent Sync API.
## Example
```go
package mainimport (
btsync "btsync-api"
"fmt"
"log"
)func main() {
// Create an instance of the client. Needs the configured
// login, password, and port of the Sync API. The last
// argument is to enable debug logging.
api := btsync.New("login", "password", 8080, true)// Get a list of Sync folders. All API methods return
// a response and an error object.
folders, err := api.GetFolders()
if err != nil {
log.Fatalf("Error! %s", err)
}
// Response objects map directly to the documented JSON
// responses. However they are Golang style (caps/camelcase).
for _, folder := range *folders {
fmt.Printf("Sync folder %s has %d files\n", folder.Dir, folder.Files)
}
// Get Sync's current upload/download speed.
speed, _ := api.GetSpeed()
fmt.Printf("Speed: upload=%d, download=%d", speed.Upload, speed.Download)
}```
## Documentation
http://godoc.org/github.com/vole/btsync-api