Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/vole/btsync-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/vole/btsync-api

  • v0.0.0-20140408205438-bf093bd028a3
  • Source
  • Go
  • Socket score

Version published
Created
Source

BTSync API

Golang client for the Bittorrent Sync API.

Example

package main

import (
  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

FAQs

Package last updated on 08 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc