Commit Graph

22 Commits

Author SHA1 Message Date
Eng Zer Jun 841a702e34
test: use `T.TempDir` to create temporary test directory (#718)
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-02-02 18:26:46 +11:00
Matt Joiner c3c982b621 Fixes for wasm 2021-06-23 17:24:50 +10:00
Matt Joiner a22c1334c6 Include webseed urls in MetaInfo.Magnet output
Fixes #469.
2021-02-24 12:11:47 +11:00
Matt Joiner 35464677ef Improve metainfo.MetaInfo.Magnet interface and add tests 2021-02-24 12:11:47 +11:00
Matt Joiner cb1bf0f413 goimports -local 2019-08-21 20:58:40 +10:00
Matt Joiner fc4fab91f5 Switch to goimports import sorting
Used to use sortimports, but it's old, and goimports seems to have an opinion now.
2018-11-02 23:12:01 +11:00
Matt Joiner d7225aed03 Fix #247 2018-04-13 17:07:19 +10:00
Matt Joiner 0e32592f78 bencode: Give more descriptive errors when failing to parse dicts 2018-01-25 21:46:50 +11:00
Matt Joiner cc17c8a54c metainfo URL list can be a string or list 2017-06-16 17:07:30 +10:00
Matt Joiner b304baad1b Add error return value to metainfo.MetaInfo.UnmarshalInfo
Too many problems caused by bad info bytes in downstream projects.
2016-09-20 12:32:15 +10:00
Matt Joiner 2a1cef7c9e Remove the InfoEx type, and don't generate its infohash on the fly
Fixes #106.
2016-08-26 20:29:05 +10:00
Matt Joiner 2490c96f2f metainfo.Info.BuildFromFilePath: Ensure stable file ordering
Spotted by @axet, with precedent in Transmission.
2016-07-07 19:40:26 +10:00
Matt Joiner 2d160b0419 metainfo.InfoEx.Hash becomes a function, UpdateBytes is added, and Bytes used in marshalling
Fixes #80.
2016-05-05 22:40:38 +10:00
Matt Joiner f83771b660 Apply ineffassign linter 2016-04-04 15:39:26 +10:00
Matt Joiner 7ed81fa708 metainfo tests: Fix some naming conventions 2016-02-23 21:50:07 +11:00
Matt Joiner 95aa411699 missinggo.ZeroReader is now a var, not a type 2016-02-05 01:20:02 +11:00
Matt Joiner f9c600b264 metainfo: Add alternative "builder" API
The existing builder API is gross and heavy-handed. I won't rip it out just yet.
2015-10-30 01:21:09 +11:00
Milos Gajdos dfd654bcde Adding trackerless.torrent metainfo file to test suite 2015-05-03 16:37:48 +01:00
Matt Joiner 526d9d738e Rewrite imports to local bencode and metainfo 2015-04-27 14:55:01 +10:00
Matt Joiner 256d2e6530 Ensure that encoded and decoded forms match 2014-12-01 23:27:17 -06:00
Matt Joiner 9d72fd024e Expose MetaData directly so it can be bencoded from external packages 2014-07-13 17:36:06 +10:00
Matt Joiner a44d2d88c3 Rename torrent package to metainfo; expose MetaInfo["info"] so it can be used on its own
--HG--
rename : torrent/README => metainfo/README
rename : torrent/_testdata/archlinux-2011.08.19-netinstall-i686.iso.torrent => metainfo/_testdata/archlinux-2011.08.19-netinstall-i686.iso.torrent
rename : torrent/_testdata/continuum.torrent => metainfo/_testdata/continuum.torrent
rename : torrent/builder.go => metainfo/builder.go
rename : torrent/metainfo.go => metainfo/metainfo.go
rename : torrent/metainfo_test.go => metainfo/metainfo_test.go
2014-06-28 19:40:39 +10:00