]> Sergey Matveev's repositories - btrtrc.git/blob - example_test.go
Merge pull request #16 from scr4t/master
[btrtrc.git] / example_test.go
1 package torrent_test
2
3 import (
4         "log"
5
6         "github.com/anacrolix/torrent"
7 )
8
9 func Example() {
10         c, _ := torrent.NewClient(&torrent.Config{})
11         defer c.Close()
12         t, _ := c.AddMagnet("magnet:?xt=urn:btih:ZOCMZQIPFFW7OLLMIC5HUB6BPCSDEOQU")
13         <-t.GotInfo()
14         t.DownloadAll()
15         c.WaitAll()
16         log.Print("ermahgerd, torrent downloaded")
17 }