0e2288565d
The first iteration for config editor and server reload from the web interface.
19 lines
439 B
Go
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)
|
|
|
|
}
|