README.md | 4 ++-- client.go | 9 +++++---- diff --git a/README.md b/README.md index fff7242a7d1f8961c486dda1c8b07e890ba92420..4827680657d8b3a7c36bc61eae5be15079b149d6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ There is support for protocol encryption, DHT, PEX, uTP, and various extensions. There are several storage backends provided, blob, file, mmap. You can use the provided binaries in `./cmd`, or use `torrent` as a library for your own applications. ## Installation -Install the library package with `go get github.com/anacrolix/torrent`, or one of the provided cmds with `go get github.com/anacrolix/...`. +Install the library package with `go get github.com/anacrolix/torrent`, or the provided cmds with `go get github.com/anacrolix/torrent/cmd/...`. ## Library example @@ -25,4 +25,4 @@ 2015/03/20 22:51:41 main.go:96: downloaded ALL the torrents $ md5sum ubuntu-14.04.1-desktop-amd64.iso 119cb63b48c9a18f31f417f09655efbd ubuntu-14.04.1-desktop-amd64.iso $ echo such amaze - wow \ No newline at end of file + wow diff --git a/client.go b/client.go index 4a4c8322fca1b44fdd55f7081e1af1deab7d7de6..570d46a661d0573b818720264f76a42cccb8e33a 100644 --- a/client.go +++ b/client.go @@ -3,12 +3,13 @@ Package torrent implements a torrent client. Simple example: - c, _ := NewClient() - t, _, c.AddMagnet("magnet:?xt=urn:btih:ZOCMZQIPFFW7OLLMIC5HUB6BPCSDEOQU") + c, _ := torrent.NewClient(&torrent.Config{}) + defer c.Close() + t, _ := c.AddMagnet("magnet:?xt=urn:btih:ZOCMZQIPFFW7OLLMIC5HUB6BPCSDEOQU") t.DownloadAll() c.WaitAll() - log.Print("erhmahgerd, torrent downloaded") - c.Close() + log.Print("ermahgerd, torrent downloaded") + */ package torrent