+//go:build !noboltdb && !wasm
+// +build !noboltdb,!wasm
+
package storage
import (
}
func NewBoltDB(filePath string) ClientImplCloser {
- db, err := bbolt.Open(filepath.Join(filePath, "bolt.db"), 0600, &bbolt.Options{
+ db, err := bbolt.Open(filepath.Join(filePath, "bolt.db"), 0o600, &bbolt.Options{
Timeout: time.Second,
})
expect.Nil(err)
return me.db.Close()
}
-func (me *boltClient) OpenTorrent(info *metainfo.Info, infoHash metainfo.Hash) (TorrentImpl, error) {
- return &boltTorrent{me, infoHash}, nil
+func (me *boltClient) OpenTorrent(_ *metainfo.Info, infoHash metainfo.Hash) (TorrentImpl, error) {
+ t := &boltTorrent{me, infoHash}
+ return TorrentImpl{
+ Piece: t.Piece,
+ Close: t.Close,
+ }, nil
}
func (me *boltTorrent) Piece(p metainfo.Piece) PieceImpl {