Commit Graph

60 Commits

Author SHA1 Message Date
Vincent Batts c9343672f0 torrent: comments and starting more tests 2016-07-07 10:55:50 -04:00
Vincent Batts 7f39bac612 documenting and testing the encoding decorator 2014-08-14 21:16:05 -04:00
Vincent Batts fe3de5af65 Revert "omitempty is not handled yet in the bencode marshalling"
This reverts commit 8bdd749035.
2014-08-14 21:07:13 -04:00
Vincent Batts dd6ecf2eac Merge branch 'omitempty' 2014-08-14 21:06:05 -04:00
Vincent Batts e27d7cfab2 now marshaller respects options like 'omitempty' 2014-08-14 21:05:31 -04:00
Vincent Batts 8bdd749035 omitempty is not handled yet in the bencode marshalling 2014-08-14 17:02:46 -04:00
Vincent Batts 058076e94f adding a time helper 2014-08-14 16:52:48 -04:00
Vincent Batts a418f5cb4b adding more fields for torrent files 2014-08-14 16:47:34 -04:00
Vincent Batts 8baf937ecf tweaks and fmt 2014-08-14 15:55:39 -04:00
Vincent Batts 8922de6783 updating the example to use the new Marshal and Unmarshal 2014-08-14 15:50:28 -04:00
Vincent Batts 0d6d4580ca bencode.Unmarshal
* matching its behavior to encoding/json.Unmarshal
* adding test for Unmarshal
2014-08-14 15:42:20 -04:00
Vincent Batts ba37eae00a switching bencode.Marshal to match other encoders 2014-08-14 15:27:07 -04:00
Vincent Batts c4a2cbbbbe gofmt and update encoding tags 2014-08-14 15:19:42 -04:00
Vincent Batts 89e4899841 adding README and torrent file bits 2014-08-14 14:48:33 -04:00
Vincent Batts 0eb8ce1253 move bencode to subdirectory
making room for other packages
2014-08-14 14:27:17 -04:00
Jack Palevich c104c8e258 Add test for whitespace in bencode name. 2014-07-27 15:47:06 +08:00
Jack Palevich 047893b8ff Support both old and new struct tag syntax.
Use "bencode" as the key.
2014-06-01 09:15:41 -07:00
Jack Palevich 25c99088bf Fix incorrect documentation.
(Left over from copy-and-paste from Go's JSON encoder/decode doc.)
2012-09-15 19:56:53 -07:00
Jack Palevich 5c36da2622 Hide Builder, StringValue, and StringValueArray types.
No need to export these types.
2012-09-15 19:46:44 -07:00
Jack Palevich 9b44363a13 Remove our own buffered Reader interface in favor of bufio.Reader 2012-09-15 19:39:35 -07:00
Jack Palevich b4ca4a1e0b Fix documentation.
Hide non-essential types and functions.
2012-09-15 19:00:31 -07:00
Yves Junqueira d41d83ce5d Merge branch 'master' of https://github.com/uriel/Taipei-Torrent into uriel-master
Conflicts:
	taipei/files.go
2012-09-06 01:13:01 +02:00
Yves Junqueira 6477af1f24 Merging 2012-09-06 00:43:29 +02:00
Yves Junqueira 31d6f31edc Use standard path library to sanitize paths.
Uncomment bencode test that has been fixed.
2012-09-05 23:20:02 +02:00
Uriel a704418110 There is some kind of off-by-one bug here and we end up with nils in the
slice.

I'm not sure exactly what the error is, but this code seems to be
ancient and predate the invention of append(), I replaced it with a call
to append() and seems to work fine.

Leaving the code commented out because I'm not satisified I understand
it.
2012-09-03 02:45:23 +02:00
Yves Junqueira 9af83c7cd1 Fix remaining bencode tests.
I'm not sure if I'm doing the right thing, though.
2012-07-29 17:59:03 +02:00
Yves Junqueira 7f9f262959 bencode fixes.
map->struct fixed.
map->struct+map fixed.
2012-07-29 15:29:17 +02:00
Yves Junqueira cf16bc67de Start fixing TestUnmarshal.
Fixed unmarshalling for int, strings and slices. TODO: Fix maps.

Related to issue #4.
2012-07-16 02:29:17 +02:00
Yves Junqueira 698be9359e Move auxiliary methods to "nettools". Run gofmt 2012-06-30 23:45:02 +02:00
Yves Junqueira c5b63065b3 Merge branch 'master' of https://github.com/jackpal/Taipei-Torrent into dht-2 2012-03-05 00:07:59 +01:00
Jack Palevich cb55dd63ce Comment out failing test.
reflect.Value is confusing.
2012-03-02 07:19:26 -08:00
Yves Junqueira 7d7d72e53c Move bencode-related methods to the bencode pkg.
This will allow a separation of the dht package.
2012-01-19 22:50:33 +01:00
Yves Junqueira 3bbf3200a7 Merge 2012-01-19 22:26:04 +01:00
Yves Junqueira 59d18812e8 Use the "go" tool for building.
Change the package structure so it can be imported as
"github.com/jackpal/Taipei-Torrent".

Remove Makefiles and helper scripts. To build, use "go build" (works
with weekly.2012-01-15).

To clean, use "go clean" (not yet available in the current weekly).

Note that the go tool expects the source code to be in a very specific
directory. See: http://tip.golang.org/doc/code.html
2012-01-19 22:18:39 +01:00
Yves Junqueira 5618c78184 merge update-0 2012-01-01 02:58:21 +01:00
Yves Junqueira 5c02c4aa77 Update bencode for weekly.2011-12-06 2011-12-17 20:36:20 +01:00
Yves Junqueira 335317be3b Update bencode for weekly.2011-12-06 2011-12-17 19:58:37 +01:00
Jack Palevich e65ed38f87 Merge remote branch 'quantumelixir/fixes' 2011-02-19 08:18:27 -08:00
Jack Palevich 3e378d6f7e Merge branch 'master' of github.com:jackpal/Taipei-Torrent
Conflicts:
	taipei/torrent.go
2011-02-19 08:12:30 -08:00
Chidambaram Annamalai 68da078750 Fixes for latest version of Go (2011 Feb)
- bytes.AddBytes replaced by append()
- reflect.ArrayCopy renamed to reflect.Copy
2011-02-12 13:47:47 +05:30
Jack Palevich 151014d5ea Merge branch 'master' of https://github.com/nictuku/Taipei-Torrent into nictuku-master
Conflicts:
	main.go
	taipei/torrent.go
2010-11-20 14:12:01 -08:00
Yves Junqueira 088e7345e0 bencode: Adding a unit-test proving that "dictionary inside a dictionary" works, as long as you know how to use it. Closes issue #2 (user error!). 2010-11-14 18:04:31 -08:00
Jack Palevich 29fe59041b Update to current Go makefile syntax. 2010-09-14 01:50:50 -07:00
Yves Junqueira 48240ee6fb bencode: Adding a unit-test proving that "dictionary inside a dictionary" works, as long as you know how to use it. Closes issue #2 (user error!). 2010-08-08 01:46:30 +02:00
Yves Junqueira 1f8b972031 Move bencode tests to common Go testing infrastructure. 2010-08-03 22:48:55 +02:00
Yves Junqueira f3b38a06e5 Small fix on bencode parse.go 2010-07-25 20:32:08 +01:00
Yves Junqueira 56e375d053 Fixing other potential problems related to redeclaring err within a inner block. Also changing harmless look-alike cases for style consistency 2010-07-25 15:30:32 +01:00
Yves Junqueira af804a47fa Fix build problem with recent go release: vector Data() was renamed to Copy(). Also changed our own decoder method to reflect this. 2010-07-21 11:28:50 +01:00
Jack Palevich 6ca7f8f160 Merge commit '464e8f86d9e8ec9d188e4b7c53ef26015147ec83'; remote branch 'nictuku/master'
Conflicts:
	torrent.go
2010-07-12 20:44:44 -07:00
Jack Palevich e7d62b2e1c Merge branch 'master' of github.com:jackpal/Taipei-Torrent 2010-07-12 20:41:57 -07:00