tstor/torrent/client.go
Antonio Navarro Perez 6a50c17cf2
Update deps (#23)
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2020-11-16 19:20:17 +01:00

18 lines
409 B
Go

package torrent
import (
"github.com/anacrolix/log"
"github.com/anacrolix/torrent"
"github.com/anacrolix/torrent/storage"
)
func NewClient(st storage.ClientImpl) (*torrent.Client, error) {
// TODO download and upload limits
torrentCfg := torrent.NewDefaultClientConfig()
torrentCfg.Logger = log.Discard
torrentCfg.Seed = true
torrentCfg.DefaultStorage = st
return torrent.NewClient(torrentCfg)
}