Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
liber
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ale
liber
Commits
bc3555a5
Commit
bc3555a5
authored
Feb 13, 2016
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch from levigo (cgo) to goleveldb (native)
parent
56539527
Changes
96
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
96 changed files
with
16795 additions
and
1153 deletions
+16795
-1153
Godeps/Godeps.json
Godeps/Godeps.json
+11
-4
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/batch.go
...thub.com/blevesearch/bleve/index/store/goleveldb/batch.go
+1
-1
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/config.go
...hub.com/blevesearch/bleve/index/store/goleveldb/config.go
+2
-2
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/iterator.go
...b.com/blevesearch/bleve/index/store/goleveldb/iterator.go
+1
-1
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/reader.go
...hub.com/blevesearch/bleve/index/store/goleveldb/reader.go
+2
-2
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/store.go
...thub.com/blevesearch/bleve/index/store/goleveldb/store.go
+2
-2
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/writer.go
...hub.com/blevesearch/bleve/index/store/goleveldb/writer.go
+1
-1
Godeps/_workspace/src/github.com/golang/snappy/.gitignore
Godeps/_workspace/src/github.com/golang/snappy/.gitignore
+11
-0
Godeps/_workspace/src/github.com/golang/snappy/AUTHORS
Godeps/_workspace/src/github.com/golang/snappy/AUTHORS
+15
-0
Godeps/_workspace/src/github.com/golang/snappy/CONTRIBUTORS
Godeps/_workspace/src/github.com/golang/snappy/CONTRIBUTORS
+37
-0
Godeps/_workspace/src/github.com/golang/snappy/LICENSE
Godeps/_workspace/src/github.com/golang/snappy/LICENSE
+27
-0
Godeps/_workspace/src/github.com/golang/snappy/README
Godeps/_workspace/src/github.com/golang/snappy/README
+7
-0
Godeps/_workspace/src/github.com/golang/snappy/decode.go
Godeps/_workspace/src/github.com/golang/snappy/decode.go
+296
-0
Godeps/_workspace/src/github.com/golang/snappy/encode.go
Godeps/_workspace/src/github.com/golang/snappy/encode.go
+393
-0
Godeps/_workspace/src/github.com/golang/snappy/snappy.go
Godeps/_workspace/src/github.com/golang/snappy/snappy.go
+77
-0
Godeps/_workspace/src/github.com/jmhodges/levigo/.gitignore
Godeps/_workspace/src/github.com/jmhodges/levigo/.gitignore
+0
-6
Godeps/_workspace/src/github.com/jmhodges/levigo/LICENSE
Godeps/_workspace/src/github.com/jmhodges/levigo/LICENSE
+0
-7
Godeps/_workspace/src/github.com/jmhodges/levigo/README.md
Godeps/_workspace/src/github.com/jmhodges/levigo/README.md
+0
-52
Godeps/_workspace/src/github.com/jmhodges/levigo/batch.go
Godeps/_workspace/src/github.com/jmhodges/levigo/batch.go
+0
-66
Godeps/_workspace/src/github.com/jmhodges/levigo/cache.go
Godeps/_workspace/src/github.com/jmhodges/levigo/cache.go
+0
-32
Godeps/_workspace/src/github.com/jmhodges/levigo/comparator.go
...s/_workspace/src/github.com/jmhodges/levigo/comparator.go
+0
-13
Godeps/_workspace/src/github.com/jmhodges/levigo/conv.go
Godeps/_workspace/src/github.com/jmhodges/levigo/conv.go
+0
-19
Godeps/_workspace/src/github.com/jmhodges/levigo/db.go
Godeps/_workspace/src/github.com/jmhodges/levigo/db.go
+0
-320
Godeps/_workspace/src/github.com/jmhodges/levigo/doc.go
Godeps/_workspace/src/github.com/jmhodges/levigo/doc.go
+0
-66
Godeps/_workspace/src/github.com/jmhodges/levigo/env.go
Godeps/_workspace/src/github.com/jmhodges/levigo/env.go
+0
-29
Godeps/_workspace/src/github.com/jmhodges/levigo/examples/comparator_example.go
...github.com/jmhodges/levigo/examples/comparator_example.go
+0
-46
Godeps/_workspace/src/github.com/jmhodges/levigo/filterpolicy.go
..._workspace/src/github.com/jmhodges/levigo/filterpolicy.go
+0
-32
Godeps/_workspace/src/github.com/jmhodges/levigo/iterator.go
Godeps/_workspace/src/github.com/jmhodges/levigo/iterator.go
+0
-150
Godeps/_workspace/src/github.com/jmhodges/levigo/options.go
Godeps/_workspace/src/github.com/jmhodges/levigo/options.go
+0
-229
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/batch.go
...orkspace/src/github.com/syndtr/goleveldb/leveldb/batch.go
+258
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/cache/cache.go
...ce/src/github.com/syndtr/goleveldb/leveldb/cache/cache.go
+676
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/cache/lru.go
...pace/src/github.com/syndtr/goleveldb/leveldb/cache/lru.go
+195
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/comparer.go
...space/src/github.com/syndtr/goleveldb/leveldb/comparer.go
+75
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go
...b.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go
+51
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/comparer/comparer.go
.../github.com/syndtr/goleveldb/leveldb/comparer/comparer.go
+57
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/db.go
.../_workspace/src/github.com/syndtr/goleveldb/leveldb/db.go
+1091
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/db_compaction.go
.../src/github.com/syndtr/goleveldb/leveldb/db_compaction.go
+828
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/db_iter.go
...kspace/src/github.com/syndtr/goleveldb/leveldb/db_iter.go
+360
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/db_snapshot.go
...ce/src/github.com/syndtr/goleveldb/leveldb/db_snapshot.go
+183
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/db_state.go
...space/src/github.com/syndtr/goleveldb/leveldb/db_state.go
+219
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/db_transaction.go
...src/github.com/syndtr/goleveldb/leveldb/db_transaction.go
+289
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/db_util.go
...kspace/src/github.com/syndtr/goleveldb/leveldb/db_util.go
+100
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/db_write.go
...space/src/github.com/syndtr/goleveldb/leveldb/db_write.go
+358
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/doc.go
..._workspace/src/github.com/syndtr/goleveldb/leveldb/doc.go
+90
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/errors.go
...rkspace/src/github.com/syndtr/goleveldb/leveldb/errors.go
+19
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/errors/errors.go
.../src/github.com/syndtr/goleveldb/leveldb/errors/errors.go
+78
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/filter.go
...rkspace/src/github.com/syndtr/goleveldb/leveldb/filter.go
+31
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/filter/bloom.go
...e/src/github.com/syndtr/goleveldb/leveldb/filter/bloom.go
+116
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/filter/filter.go
.../src/github.com/syndtr/goleveldb/leveldb/filter/filter.go
+60
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/iterator/array_iter.go
...ithub.com/syndtr/goleveldb/leveldb/iterator/array_iter.go
+184
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter.go
...hub.com/syndtr/goleveldb/leveldb/iterator/indexed_iter.go
+242
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/iterator/iter.go
.../src/github.com/syndtr/goleveldb/leveldb/iterator/iter.go
+131
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter.go
...thub.com/syndtr/goleveldb/leveldb/iterator/merged_iter.go
+304
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/journal/journal.go
...rc/github.com/syndtr/goleveldb/leveldb/journal/journal.go
+521
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/key.go
..._workspace/src/github.com/syndtr/goleveldb/leveldb/key.go
+147
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go
...ce/src/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go
+471
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/opt/options.go
...ce/src/github.com/syndtr/goleveldb/leveldb/opt/options.go
+660
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/options.go
...kspace/src/github.com/syndtr/goleveldb/leveldb/options.go
+107
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/session.go
...kspace/src/github.com/syndtr/goleveldb/leveldb/session.go
+207
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/session_compaction.go
...github.com/syndtr/goleveldb/leveldb/session_compaction.go
+302
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/session_record.go
...src/github.com/syndtr/goleveldb/leveldb/session_record.go
+323
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/session_util.go
...e/src/github.com/syndtr/goleveldb/leveldb/session_util.go
+252
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/storage/file_storage.go
...thub.com/syndtr/goleveldb/leveldb/storage/file_storage.go
+583
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/storage/file_storage_plan9.go
...om/syndtr/goleveldb/leveldb/storage/file_storage_plan9.go
+65
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/storage/file_storage_solaris.go
.../syndtr/goleveldb/leveldb/storage/file_storage_solaris.go
+81
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go
...com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go
+86
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/storage/file_storage_windows.go
.../syndtr/goleveldb/leveldb/storage/file_storage_windows.go
+78
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go
...ithub.com/syndtr/goleveldb/leveldb/storage/mem_storage.go
+218
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/storage/storage.go
...rc/github.com/syndtr/goleveldb/leveldb/storage/storage.go
+177
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/table.go
...orkspace/src/github.com/syndtr/goleveldb/leveldb/table.go
+530
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/table/reader.go
...e/src/github.com/syndtr/goleveldb/leveldb/table/reader.go
+1107
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/table/table.go
...ce/src/github.com/syndtr/goleveldb/leveldb/table/table.go
+177
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/table/writer.go
...e/src/github.com/syndtr/goleveldb/leveldb/table/writer.go
+375
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/testutil/db.go
...ce/src/github.com/syndtr/goleveldb/leveldb/testutil/db.go
+222
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/testutil/ginkgo.go
...rc/github.com/syndtr/goleveldb/leveldb/testutil/ginkgo.go
+21
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/testutil/iter.go
.../src/github.com/syndtr/goleveldb/leveldb/testutil/iter.go
+327
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/testutil/kv.go
...ce/src/github.com/syndtr/goleveldb/leveldb/testutil/kv.go
+352
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/testutil/kvtest.go
...rc/github.com/syndtr/goleveldb/leveldb/testutil/kvtest.go
+211
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/testutil/storage.go
...c/github.com/syndtr/goleveldb/leveldb/testutil/storage.go
+694
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/testutil/util.go
.../src/github.com/syndtr/goleveldb/leveldb/testutil/util.go
+171
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util.go
...workspace/src/github.com/syndtr/goleveldb/leveldb/util.go
+91
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util/buffer.go
...ce/src/github.com/syndtr/goleveldb/leveldb/util/buffer.go
+293
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go
...c/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go
+239
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util/crc32.go
...ace/src/github.com/syndtr/goleveldb/leveldb/util/crc32.go
+30
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util/hash.go
...pace/src/github.com/syndtr/goleveldb/leveldb/util/hash.go
+48
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util/pool.go
...pace/src/github.com/syndtr/goleveldb/leveldb/util/pool.go
+21
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util/pool_legacy.go
...c/github.com/syndtr/goleveldb/leveldb/util/pool_legacy.go
+33
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util/range.go
...ace/src/github.com/syndtr/goleveldb/leveldb/util/range.go
+32
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util/util.go
...pace/src/github.com/syndtr/goleveldb/leveldb/util/util.go
+73
-0
Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/version.go
...kspace/src/github.com/syndtr/goleveldb/leveldb/version.go
+521
-0
cmd/liber/liber.go
cmd/liber/liber.go
+0
-1
cmd/liberdbtool/liberdbtool.go
cmd/liberdbtool/liberdbtool.go
+4
-2
database.go
database.go
+48
-63
sync.go
sync.go
+3
-1
update.go
update.go
+3
-1
update_test.go
update_test.go
+13
-5
No files found.
Godeps/Godeps.json
View file @
bc3555a5
{
"ImportPath"
:
"git.autistici.org/ale/liber"
,
"GoVersion"
:
"go1.5.3"
,
"Packages"
:
[
"."
],
"Deps"
:
[
{
"ImportPath"
:
"github.com/blevesearch/bleve"
,
...
...
@@ -24,6 +27,10 @@
"ImportPath"
:
"github.com/golang/protobuf/proto"
,
"Rev"
:
"0dfe8f37844c14cb32c7247925270e0f7ba90973"
},
{
"ImportPath"
:
"github.com/golang/snappy"
,
"Rev"
:
"c2359a1bd0bd4a2de4f1bd92ccd045fb60d0a994"
},
{
"ImportPath"
:
"github.com/gorilla/context"
,
"Rev"
:
"14f550f51af52180c2eefed15e5fd18d63c0a64a"
...
...
@@ -32,10 +39,6 @@
"ImportPath"
:
"github.com/gorilla/mux"
,
"Rev"
:
"14cafe28513321476c73967a5a4f3454b6129c46"
},
{
"ImportPath"
:
"github.com/jmhodges/levigo"
,
"Rev"
:
"251e8f03dd397a865450836879aa350af87dd1de"
},
{
"ImportPath"
:
"github.com/meskio/epubgo"
,
"Rev"
:
"815a36010f173a9ff64115e7ce4eafeed82fd404"
...
...
@@ -48,6 +51,10 @@
"ImportPath"
:
"github.com/steveyen/gtreap"
,
"Rev"
:
"0abe01ef9be25c4aedc174758ec2d917314d6d70"
},
{
"ImportPath"
:
"github.com/syndtr/goleveldb/leveldb"
,
"Rev"
:
"e7e6f5b5ef25adb580feac515f9ccec514d0bda8"
},
{
"ImportPath"
:
"github.com/willf/bitset"
,
"Comment"
:
"v1.0.0-51-g9e6a3a7"
,
...
...
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/batch.go
View file @
bc3555a5
...
...
@@ -11,7 +11,7 @@ package goleveldb
import
(
"git.autistici.org/ale/liber/Godeps/_workspace/src/github.com/blevesearch/bleve/index/store"
"github.com/syndtr/goleveldb/leveldb"
"git
.autistici.org/ale/liber/Godeps/_workspace/src/git
hub.com/syndtr/goleveldb/leveldb"
)
type
Batch
struct
{
...
...
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/config.go
View file @
bc3555a5
package
goleveldb
import
(
"github.com/syndtr/goleveldb/leveldb/filter"
"github.com/syndtr/goleveldb/leveldb/opt"
"git
.autistici.org/ale/liber/Godeps/_workspace/src/git
hub.com/syndtr/goleveldb/leveldb/filter"
"git
.autistici.org/ale/liber/Godeps/_workspace/src/git
hub.com/syndtr/goleveldb/leveldb/opt"
)
func
applyConfig
(
o
*
opt
.
Options
,
config
map
[
string
]
interface
{})
(
*
opt
.
Options
,
error
)
{
...
...
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/iterator.go
View file @
bc3555a5
...
...
@@ -9,7 +9,7 @@
package
goleveldb
import
"github.com/syndtr/goleveldb/leveldb/iterator"
import
"git
.autistici.org/ale/liber/Godeps/_workspace/src/git
hub.com/syndtr/goleveldb/leveldb/iterator"
type
Iterator
struct
{
store
*
Store
...
...
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/reader.go
View file @
bc3555a5
...
...
@@ -11,8 +11,8 @@ package goleveldb
import
(
"git.autistici.org/ale/liber/Godeps/_workspace/src/github.com/blevesearch/bleve/index/store"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util"
"git
.autistici.org/ale/liber/Godeps/_workspace/src/git
hub.com/syndtr/goleveldb/leveldb"
"git
.autistici.org/ale/liber/Godeps/_workspace/src/git
hub.com/syndtr/goleveldb/leveldb/util"
)
type
Reader
struct
{
...
...
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/store.go
View file @
bc3555a5
...
...
@@ -14,8 +14,8 @@ import (
"git.autistici.org/ale/liber/Godeps/_workspace/src/github.com/blevesearch/bleve/index/store"
"git.autistici.org/ale/liber/Godeps/_workspace/src/github.com/blevesearch/bleve/registry"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/opt"
"git
.autistici.org/ale/liber/Godeps/_workspace/src/git
hub.com/syndtr/goleveldb/leveldb"
"git
.autistici.org/ale/liber/Godeps/_workspace/src/git
hub.com/syndtr/goleveldb/leveldb/opt"
)
const
Name
=
"goleveldb"
...
...
Godeps/_workspace/src/github.com/blevesearch/bleve/index/store/goleveldb/writer.go
View file @
bc3555a5
...
...
@@ -13,7 +13,7 @@ import (
"fmt"
"git.autistici.org/ale/liber/Godeps/_workspace/src/github.com/blevesearch/bleve/index/store"
"github.com/syndtr/goleveldb/leveldb"
"git
.autistici.org/ale/liber/Godeps/_workspace/src/git
hub.com/syndtr/goleveldb/leveldb"
)
type
Writer
struct
{
...
...
Godeps/_workspace/src/github.com/golang/snappy/.gitignore
0 → 100644
View file @
bc3555a5
testdata/alice29.txt
testdata/asyoulik.txt
testdata/fireworks.jpeg
testdata/geo.protodata
testdata/html
testdata/html_x_4
testdata/kppkn.gtb
testdata/lcet10.txt
testdata/paper-100k.pdf
testdata/plrabn12.txt
testdata/urls.10K
Godeps/_workspace/src/github.com/golang/snappy/AUTHORS
0 → 100644
View file @
bc3555a5
# This is the official list of Snappy-Go authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.
# Names should be added to this file as
# Name or Organization <email address>
# The email address is not required for organizations.
# Please keep the list sorted.
Damian Gryski <dgryski@gmail.com>
Google Inc.
Jan Mercl <0xjnml@gmail.com>
Rodolfo Carvalho <rhcarvalho@gmail.com>
Sebastien Binet <seb.binet@gmail.com>
Godeps/_workspace/src/github.com/golang/snappy/CONTRIBUTORS
0 → 100644
View file @
bc3555a5
# This is the official list of people who can contribute
# (and typically have contributed) code to the Snappy-Go repository.
# The AUTHORS file lists the copyright holders; this file
# lists people. For example, Google employees are listed here
# but not in AUTHORS, because Google holds the copyright.
#
# The submission process automatically checks to make sure
# that people submitting code are listed in this file (by email address).
#
# Names should be added to this file only after verifying that
# the individual or the individual's organization has agreed to
# the appropriate Contributor License Agreement, found here:
#
# http://code.google.com/legal/individual-cla-v1.0.html
# http://code.google.com/legal/corporate-cla-v1.0.html
#
# The agreement for individuals can be filled out on the web.
#
# When adding J Random Contributor's name to this file,
# either J's name or J's organization's name should be
# added to the AUTHORS file, depending on whether the
# individual or corporate CLA was used.
# Names should be added to this file like so:
# Name <email address>
# Please keep the list sorted.
Damian Gryski <dgryski@gmail.com>
Jan Mercl <0xjnml@gmail.com>
Kai Backman <kaib@golang.org>
Marc-Antoine Ruel <maruel@chromium.org>
Nigel Tao <nigeltao@golang.org>
Rob Pike <r@golang.org>
Rodolfo Carvalho <rhcarvalho@gmail.com>
Russ Cox <rsc@golang.org>
Sebastien Binet <seb.binet@gmail.com>
Godeps/_workspace/src/github.com/golang/snappy/LICENSE
0 → 100644
View file @
bc3555a5
Copyright (c) 2011 The Snappy-Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Godeps/_workspace/src/github.com/golang/snappy/README
0 → 100644
View file @
bc3555a5
The Snappy compression format in the Go programming language.
To download and install from source:
$ go get github.com/golang/snappy
Unless otherwise noted, the Snappy-Go source files are distributed
under the BSD-style license found in the LICENSE file.
Godeps/_workspace/src/github.com/golang/snappy/decode.go
0 → 100644
View file @
bc3555a5
// Copyright 2011 The Snappy-Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
snappy
import
(
"encoding/binary"
"errors"
"io"
)
var
(
// ErrCorrupt reports that the input is invalid.
ErrCorrupt
=
errors
.
New
(
"snappy: corrupt input"
)
// ErrTooLarge reports that the uncompressed length is too large.
ErrTooLarge
=
errors
.
New
(
"snappy: decoded block is too large"
)
// ErrUnsupported reports that the input isn't supported.
ErrUnsupported
=
errors
.
New
(
"snappy: unsupported input"
)
errUnsupportedCopy4Tag
=
errors
.
New
(
"snappy: unsupported COPY_4 tag"
)
errUnsupportedLiteralLength
=
errors
.
New
(
"snappy: unsupported literal length"
)
)
// DecodedLen returns the length of the decoded block.
func
DecodedLen
(
src
[]
byte
)
(
int
,
error
)
{
v
,
_
,
err
:=
decodedLen
(
src
)
return
v
,
err
}
// decodedLen returns the length of the decoded block and the number of bytes
// that the length header occupied.
func
decodedLen
(
src
[]
byte
)
(
blockLen
,
headerLen
int
,
err
error
)
{
v
,
n
:=
binary
.
Uvarint
(
src
)
if
n
<=
0
||
v
>
0xffffffff
{
return
0
,
0
,
ErrCorrupt
}
const
wordSize
=
32
<<
(
^
uint
(
0
)
>>
32
&
1
)
if
wordSize
==
32
&&
v
>
0x7fffffff
{
return
0
,
0
,
ErrTooLarge
}
return
int
(
v
),
n
,
nil
}
// Decode returns the decoded form of src. The returned slice may be a sub-
// slice of dst if dst was large enough to hold the entire decoded block.
// Otherwise, a newly allocated slice will be returned.
// It is valid to pass a nil dst.
func
Decode
(
dst
,
src
[]
byte
)
([]
byte
,
error
)
{
dLen
,
s
,
err
:=
decodedLen
(
src
)
if
err
!=
nil
{
return
nil
,
err
}
if
len
(
dst
)
<
dLen
{
dst
=
make
([]
byte
,
dLen
)
}
var
d
,
offset
,
length
int
for
s
<
len
(
src
)
{
switch
src
[
s
]
&
0x03
{
case
tagLiteral
:
x
:=
uint
(
src
[
s
]
>>
2
)
switch
{
case
x
<
60
:
s
++
case
x
==
60
:
s
+=
2
if
uint
(
s
)
>
uint
(
len
(
src
))
{
// The uint conversions catch overflow from the previous line.
return
nil
,
ErrCorrupt
}
x
=
uint
(
src
[
s
-
1
])
case
x
==
61
:
s
+=
3
if
uint
(
s
)
>
uint
(
len
(
src
))
{
// The uint conversions catch overflow from the previous line.
return
nil
,
ErrCorrupt
}
x
=
uint
(
src
[
s
-
2
])
|
uint
(
src
[
s
-
1
])
<<
8
case
x
==
62
:
s
+=
4
if
uint
(
s
)
>
uint
(
len
(
src
))
{
// The uint conversions catch overflow from the previous line.
return
nil
,
ErrCorrupt
}
x
=
uint
(
src
[
s
-
3
])
|
uint
(
src
[
s
-
2
])
<<
8
|
uint
(
src
[
s
-
1
])
<<
16
case
x
==
63
:
s
+=
5
if
uint
(
s
)
>
uint
(
len
(
src
))
{
// The uint conversions catch overflow from the previous line.
return
nil
,
ErrCorrupt
}
x
=
uint
(
src
[
s
-
4
])
|
uint
(
src
[
s
-
3
])
<<
8
|
uint
(
src
[
s
-
2
])
<<
16
|
uint
(
src
[
s
-
1
])
<<
24
}
length
=
int
(
x
+
1
)
if
length
<=
0
{
return
nil
,
errUnsupportedLiteralLength
}
if
length
>
len
(
dst
)
-
d
||
length
>
len
(
src
)
-
s
{
return
nil
,
ErrCorrupt
}
copy
(
dst
[
d
:
],
src
[
s
:
s
+
length
])
d
+=
length
s
+=
length
continue
case
tagCopy1
:
s
+=
2
if
s
>
len
(
src
)
{
return
nil
,
ErrCorrupt
}
length
=
4
+
int
(
src
[
s
-
2
])
>>
2
&
0x7
offset
=
int
(
src
[
s
-
2
])
&
0xe0
<<
3
|
int
(
src
[
s
-
1
])
case
tagCopy2
:
s
+=
3
if
s
>
len
(
src
)
{
return
nil
,
ErrCorrupt
}
length
=
1
+
int
(
src
[
s
-
3
])
>>
2
offset
=
int
(
src
[
s
-
2
])
|
int
(
src
[
s
-
1
])
<<
8
case
tagCopy4
:
return
nil
,
errUnsupportedCopy4Tag
}
if
offset
<=
0
||
d
<
offset
||
length
>
len
(
dst
)
-
d
{
return
nil
,
ErrCorrupt
}
for
end
:=
d
+
length
;
d
!=
end
;
d
++
{
dst
[
d
]
=
dst
[
d
-
offset
]
}
}
if
d
!=
dLen
{
return
nil
,
ErrCorrupt
}
return
dst
[
:
d
],
nil
}
// NewReader returns a new Reader that decompresses from r, using the framing
// format described at
// https://github.com/google/snappy/blob/master/framing_format.txt
func
NewReader
(
r
io
.
Reader
)
*
Reader
{
return
&
Reader
{
r
:
r
,
decoded
:
make
([]
byte
,
maxUncompressedChunkLen
),
buf
:
make
([]
byte
,
maxEncodedLenOfMaxUncompressedChunkLen
+
checksumSize
),
}
}
// Reader is an io.Reader that can read Snappy-compressed bytes.
type
Reader
struct
{
r
io
.
Reader
err
error
decoded
[]
byte
buf
[]
byte
// decoded[i:j] contains decoded bytes that have not yet been passed on.
i
,
j
int
readHeader
bool
}
// Reset discards any buffered data, resets all state, and switches the Snappy
// reader to read from r. This permits reusing a Reader rather than allocating
// a new one.
func
(
r
*
Reader
)
Reset
(
reader
io
.
Reader
)
{
r
.
r
=
reader
r
.
err
=
nil
r
.
i
=
0
r
.
j
=
0
r
.
readHeader
=
false
}
func
(
r
*
Reader
)
readFull
(
p
[]
byte
)
(
ok
bool
)
{
if
_
,
r
.
err
=
io
.
ReadFull
(
r
.
r
,
p
);
r
.
err
!=
nil
{
if
r
.
err
==
io
.
ErrUnexpectedEOF
{
r
.
err
=
ErrCorrupt
}
return
false
}
return
true
}
// Read satisfies the io.Reader interface.
func
(
r
*
Reader
)
Read
(
p
[]
byte
)
(
int
,
error
)
{
if
r
.
err
!=
nil
{
return
0
,
r
.
err
}
for
{
if
r
.
i
<
r
.
j
{
n
:=
copy
(
p
,
r
.
decoded
[
r
.
i
:
r
.
j
])
r
.
i
+=
n
return
n
,
nil
}
if
!
r
.
readFull
(
r
.
buf
[
:
4
])
{
return
0
,
r
.
err
}
chunkType
:=
r
.
buf
[
0
]
if
!
r
.
readHeader
{
if
chunkType
!=
chunkTypeStreamIdentifier
{
r
.
err
=
ErrCorrupt
return
0
,
r
.
err
}
r
.
readHeader
=
true
}
chunkLen
:=
int
(
r
.
buf
[
1
])
|
int
(
r
.
buf
[
2
])
<<
8
|
int
(
r
.
buf
[
3
])
<<
16
if
chunkLen
>
len
(
r
.
buf
)
{
r
.
err
=
ErrUnsupported
return
0
,
r
.
err
}
// The chunk types are specified at
// https://github.com/google/snappy/blob/master/framing_format.txt
switch
chunkType
{
case
chunkTypeCompressedData
:
// Section 4.2. Compressed data (chunk type 0x00).
if
chunkLen
<
checksumSize
{
r
.
err
=
ErrCorrupt
return
0
,
r
.
err
}
buf
:=
r
.
buf
[
:
chunkLen
]
if
!
r
.
readFull
(
buf
)
{
return
0
,
r
.
err
}
checksum
:=
uint32
(
buf
[
0
])
|
uint32
(
buf
[
1
])
<<
8
|
uint32
(
buf
[
2
])
<<
16
|
uint32
(
buf
[
3
])
<<
24
buf
=
buf
[
checksumSize
:
]
n
,
err
:=
DecodedLen
(
buf
)
if
err
!=
nil
{
r
.
err
=
err
return
0
,
r
.
err
}
if
n
>
len
(
r
.
decoded
)
{
r
.
err
=
ErrCorrupt
return
0
,
r
.
err
}
if
_
,
err
:=
Decode
(
r
.
decoded
,
buf
);
err
!=
nil
{
r
.
err
=
err
return
0
,
r
.
err
}
if
crc
(
r
.
decoded
[
:
n
])
!=
checksum
{
r
.
err
=
ErrCorrupt
return
0
,
r
.
err
}
r
.
i
,
r
.
j
=
0
,
n
continue
case
chunkTypeUncompressedData
:
// Section 4.3. Uncompressed data (chunk type 0x01).
if
chunkLen
<
checksumSize
{
r
.
err
=
ErrCorrupt
return
0
,
r
.
err
}
buf
:=
r
.
buf
[
:
checksumSize
]
if
!
r
.
readFull
(
buf
)
{
return
0
,
r
.
err
}
checksum
:=
uint32
(
buf
[
0
])
|
uint32
(
buf
[
1
])
<<
8
|
uint32
(
buf
[
2
])
<<
16
|
uint32
(
buf
[
3
])
<<
24
// Read directly into r.decoded instead of via r.buf.
n
:=
chunkLen
-
checksumSize
if
!
r
.
readFull
(
r
.
decoded
[
:
n
])
{
return
0
,
r
.
err
}
if
crc
(
r
.
decoded
[
:
n
])
!=
checksum
{
r
.
err
=
ErrCorrupt
return
0
,
r
.
err
}
r
.
i
,
r
.
j
=
0
,
n
continue
case
chunkTypeStreamIdentifier
:
// Section 4.1. Stream identifier (chunk type 0xff).
if
chunkLen
!=
len
(
magicBody
)
{
r
.
err
=
ErrCorrupt
return
0
,
r
.
err
}
if
!
r
.
readFull
(
r
.
buf
[
:
len
(
magicBody
)])
{
return
0
,
r
.
err
}
for
i
:=
0
;
i
<
len
(
magicBody
);
i
++
{
if
r
.
buf
[
i
]
!=
magicBody
[
i
]
{
r
.
err
=
ErrCorrupt
return
0
,
r
.
err
}
}
continue
}
if
chunkType
<=
0x7f
{
// Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f).
r
.
err
=
ErrUnsupported
return
0
,
r
.
err
}
// Section 4.4 Padding (chunk type 0xfe).
// Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd).
if
!
r
.
readFull
(
r
.
buf
[
:
chunkLen
])
{
return
0
,
r
.
err
}
}
}
Godeps/_workspace/src/github.com/golang/snappy/encode.go
0 → 100644
View file @
bc3555a5
// Copyright 2011 The Snappy-Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
snappy
import
(
"encoding/binary"
"errors"
"io"
)
// We limit how far copy back-references can go, the same as the C++ code.
const
maxOffset
=
1
<<
15
// emitLiteral writes a literal chunk and returns the number of bytes written.
func
emitLiteral
(
dst
,
lit
[]
byte
)
int
{
i
,
n
:=
0
,
uint
(
len
(
lit
)
-
1
)
switch
{
case
n
<
60
:
dst
[
0
]
=
uint8
(
n
)
<<
2
|
tagLiteral
i
=
1
case
n
<
1
<<
8
:
dst
[
0
]
=
60
<<
2
|
tagLiteral
dst
[
1
]
=
uint8
(
n
)
i
=
2
case
n
<
1
<<
16
:
dst
[
0
]
=
61
<<
2
|
tagLiteral
dst
[
1
]
=
uint8
(
n
)
dst
[
2
]
=
uint8
(
n
>>
8
)
i
=
3
case
n
<
1
<<
24
:
dst
[
0
]
=
62
<<
2
|
tagLiteral
dst
[
1
]
=
uint8
(
n
)
dst
[
2
]
=
uint8
(
n
>>
8
)
dst
[
3
]
=
uint8
(
n
>>
16
)
i
=
4
case
int64
(
n
)
<
1
<<
32
:
dst
[
0
]
=
63
<<
2
|
tagLiteral
dst
[
1
]
=
uint8
(
n
)
dst
[
2
]
=
uint8
(
n
>>
8
)
dst
[
3
]
=
uint8
(
n
>>
16
)
dst
[
4
]
=
uint8
(
n
>>
24
)
i
=
5
default
:
panic
(
"snappy: source buffer is too long"
)
}
if
copy
(
dst
[
i
:
],
lit
)
!=
len
(
lit
)
{
panic
(
"snappy: destination buffer is too short"
)