Commit Graph

11 Commits

Author SHA1 Message Date
Thomas Corbière ee67e34519 Fix lint errors (#190)
* use increment and decrement operators.

* remove unnecessary else branches.

* fix receiver names.

* remove omittable code.

* fix dot imports.
2018-04-03 12:23:28 +02:00
Jae Kwon d289c9286e
Implement NewPrefixDB (#164)
* encodeByteSlice uses uvarint for length instead of varint
* Implemented NewPrefixDB
* Fix flowrate test (#165)
* Complete implementation and fix tests
* Add tests for MemBatch Write[Sync]
2018-03-15 09:43:23 -07:00
Jae Kwon b31397aff5 Fix GoLevelDB Iterator which needs to copy a temp []byte 2017-12-28 18:30:56 -08:00
Jae Kwon 4ce8448d7f
Nil keys are OK, deprecate BeginningKey/EndingKey (#101)
* Nil keys are OK, deprecate BeginningKey/EndingKey
2017-12-17 13:11:28 -08:00
Emmanuel Odeke a7b20d4e46
db: Simplify exists check, fix IsKeyInDomain signature, Iterator Close
+ *FSDB.HasKey now uses common.FileExists to test for file existence
+ IsKeyInDomain takes key as a []byte slice instead of as a string
to avoid extraneous []byte<-->string conversions for start and end
+ Iterator.Close() instead of Iterator.Release()
+ withDB helper to encapsulate DB creation, deferred cleanups
so that for loops can use opened DBs and discard them ASAP

Addressing accepted changes from review with @jaekwon
2017-12-15 02:58:51 -07:00
Jae Kwon 5636a02d03 Remove GetError() from Iterator 2017-12-12 19:19:26 -08:00
Ethan Buchman 5b7f90dfb2 db: test panic on nil key 2017-12-12 18:42:47 -05:00
Ethan Buchman 781f6c5d22 db: some comments in types.go 2017-12-12 18:04:05 -05:00
Jae Kwon 7f650cea86 Remove Prev from Iterator 2017-12-12 14:45:31 -08:00
Jae Kwon 0d03cd9e31 Make it compile 2017-12-12 14:00:03 -08:00
Jae Kwon 50a30aafc1 New canonical Iterator 2017-12-12 12:44:47 -08:00