Reload server and edit configuration. ()

The first iteration for config editor and server reload from the web interface.
This commit is contained in:
Antonio Navarro Perez 2020-11-08 18:19:25 +01:00 committed by GitHub
parent 56d32fd1f4
commit 0e2288565d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 882 additions and 178 deletions
torrent

19
torrent/client.go Normal file
View file

@ -0,0 +1,19 @@
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)
}