tstor/torrent/client.go
Antonio Navarro Perez 0e2288565d
Reload server and edit configuration. (#15)
The first iteration for config editor and server reload from the web interface.
2020-11-08 18:19:25 +01:00

19 lines
439 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.DisableTCP = true
torrentCfg.DefaultStorage = st
return torrent.NewClient(torrentCfg)
}