@cryptotaxi247 / kubo / commits / 54032ce38

updated vendoring

Juan Batiz-Benet committed Oct 22, 2014 at 05:29 UTC 54032ce38bb7b510dbc81c8dc70375ed8ef662b4
8 files changed +6 -235
Godeps/Godeps.json
+5 -5
@@ -1,6 +1,6 @@
1 {
2 "ImportPath": "github.com/jbenet/go-ipfs",
3 - "GoVersion": "go1.3.3",
3 + "GoVersion": "go1.3",
4 "Packages": [
5 "./..."
6 ],
@@ -66,14 +66,14 @@
66 "ImportPath": "github.com/jbenet/commander",
67 "Rev": "e0cf317891f0ab6f1ac64dfcb754b4fb5e69f7df"
68 },
69 - {
70 - "ImportPath": "github.com/jbenet/go-datastore",
71 - "Rev": "da593f5071b3ce60bf45b548193863bc3c885c3c"
72 - },
69 {
70 "ImportPath": "github.com/jbenet/go-base58",
71 "Rev": "568a28d73fd97651d3442392036a658b6976eed5"
72 },
73 + {
74 + "ImportPath": "github.com/jbenet/go-datastore",
75 + "Rev": "da593f5071b3ce60bf45b548193863bc3c885c3c"
76 + },
77 {
78 "ImportPath": "github.com/jbenet/go-is-domain",
79 "Rev": "93b717f2ae17838a265e30277275ee99ee7198d6"
Godeps/_workspace/src/github.com/jbenet/datastore.go/keytransform/doc.go deleted
-25
@@ -1,25 +0,0 @@
1 -// Package keytransform introduces a Datastore Shim that transforms keys before
2 -// passing them to its child. It can be used to manipulate what keys look like
3 -// to the user, for example namespacing keys, reversing them, etc.
4 -//
5 -// Use the Wrap function to wrap a datastore with any KeyTransform.
6 -// A KeyTransform is simply an interface with two functions, a conversion and
7 -// its inverse. For example:
8 -//
9 -// import (
10 -// ktds "github.com/jbenet/datastore.go/keytransform"
11 -// ds "github.com/jbenet/datastore.go"
12 -// )
13 -//
14 -// func reverseKey(k ds.Key) ds.Key {
15 -// return k.Reverse()
16 -// }
17 -//
18 -// func invertKeys(d ds.Datastore) {
19 -// return ktds.Wrap(d, &ktds.Pair{
20 -// Convert: reverseKey,
21 -// Invert: reverseKey, // reverse is its own inverse.
22 -// })
23 -// }
24 -//
25 -package keytransform
Godeps/_workspace/src/github.com/jbenet/datastore.go/keytransform/interface.go deleted
-34
@@ -1,34 +0,0 @@
1 -package keytransform
2 -
3 -import ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
4 -
5 -// KeyMapping is a function that maps one key to annother
6 -type KeyMapping func(ds.Key) ds.Key
7 -
8 -// KeyTransform is an object with a pair of functions for (invertibly)
9 -// transforming keys
10 -type KeyTransform interface {
11 - ConvertKey(ds.Key) ds.Key
12 - InvertKey(ds.Key) ds.Key
13 -}
14 -
15 -// Datastore is a keytransform.Datastore
16 -type Datastore interface {
17 - ds.Shim
18 - KeyTransform
19 -}
20 -
21 -// Wrap wraps a given datastore with a KeyTransform function.
22 -// The resulting wrapped datastore will use the transform on all Datastore
23 -// operations.
24 -func Wrap(child ds.Datastore, t KeyTransform) Datastore {
25 - if t == nil {
26 - panic("t (KeyTransform) is nil")
27 - }
28 -
29 - if child == nil {
30 - panic("child (ds.Datastore) is nil")
31 - }
32 -
33 - return &ktds{child: child, KeyTransform: t}
34 -}
Godeps/_workspace/src/github.com/jbenet/datastore.go/namespace/doc.go deleted
-24
@@ -1,24 +0,0 @@
1 -// Package namespace introduces a namespace Datastore Shim, which basically
2 -// mounts the entire child datastore under a prefix.
3 -//
4 -// Use the Wrap function to wrap a datastore with any Key prefix. For example:
5 -//
6 -// import (
7 -// "fmt"
8 -//
9 -// ds "github.com/jbenet/datastore.go"
10 -// nsds "github.com/jbenet/datastore.go/namespace"
11 -// )
12 -//
13 -// func main() {
14 -// mp := ds.NewMapDatastore()
15 -// ns := nsds.Wrap(mp, ds.NewKey("/foo/bar"))
16 -//
17 -// // in the Namespace Datastore:
18 -// ns.Put(ds.NewKey("/beep"), "boop")
19 -// v2, _ := ns.Get(ds.NewKey("/beep")) // v2 == "boop"
20 -//
21 -// // and, in the underlying MapDatastore:
22 -// v3, _ := mp.Get(ds.NewKey("/foo/bar/beep")) // v3 == "boop"
23 -// }
24 -package namespace
Godeps/_workspace/src/github.com/jbenet/datastore.go/namespace/example_test.go deleted
-30
@@ -1,30 +0,0 @@
1 -package namespace_test
2 -
3 -import (
4 - "fmt"
5 -
6 - ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
7 - nsds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go/namespace"
8 -)
9 -
10 -func Example() {
11 - mp := ds.NewMapDatastore()
12 - ns := nsds.Wrap(mp, ds.NewKey("/foo/bar"))
13 -
14 - k := ds.NewKey("/beep")
15 - v := "boop"
16 -
17 - ns.Put(k, v)
18 - fmt.Printf("ns.Put %s %s\n", k, v)
19 -
20 - v2, _ := ns.Get(k)
21 - fmt.Printf("ns.Get %s -> %s\n", k, v2)
22 -
23 - k3 := ds.NewKey("/foo/bar/beep")
24 - v3, _ := mp.Get(k3)
25 - fmt.Printf("mp.Get %s -> %s\n", k3, v3)
26 - // Output:
27 - // ns.Put /beep -> boop
28 - // ns.Get /beep -> boop
29 - // mp.Get /foo/bar/beep -> boop
30 -}
Godeps/_workspace/src/github.com/jbenet/datastore.go/namespace/namespace.go deleted
-44
@@ -1,44 +0,0 @@
1 -package namespace
2 -
3 -import (
4 - "fmt"
5 - "strings"
6 -
7 - ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
8 - ktds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go/keytransform"
9 -)
10 -
11 -// PrefixTransform constructs a KeyTransform with a pair of functions that
12 -// add or remove the given prefix key.
13 -//
14 -// Warning: will panic if prefix not found when it should be there. This is
15 -// to avoid insidious data inconsistency errors.
16 -func PrefixTransform(prefix ds.Key) ktds.KeyTransform {
17 - return &ktds.Pair{
18 -
19 - // Convert adds the prefix
20 - Convert: func(k ds.Key) ds.Key {
21 - return prefix.Child(k)
22 - },
23 -
24 - // Invert removes the prefix. panics if prefix not found.
25 - Invert: func(k ds.Key) ds.Key {
26 - if !prefix.IsAncestorOf(k) {
27 - fmt.Errorf("Expected prefix (%s) in key (%s)", prefix, k)
28 - panic("expected prefix not found")
29 - }
30 -
31 - s := strings.TrimPrefix(k.String(), prefix.String())
32 - return ds.NewKey(s)
33 - },
34 - }
35 -}
36 -
37 -// Wrap wraps a given datastore with a key-prefix.
38 -func Wrap(child ds.Datastore, prefix ds.Key) ktds.Datastore {
39 - if child == nil {
40 - panic("child (ds.Datastore) is nil")
41 - }
42 -
43 - return ktds.Wrap(child, PrefixTransform(prefix))
44 -}
Godeps/_workspace/src/github.com/jbenet/datastore.go/namespace/namespace_test.go deleted
-72
@@ -1,72 +0,0 @@
1 -package namespace_test
2 -
3 -import (
4 - "bytes"
5 - "sort"
6 - "testing"
7 -
8 - ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
9 - ns "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go/namespace"
10 - . "launchpad.net/gocheck"
11 -)
12 -
13 -// Hook up gocheck into the "go test" runner.
14 -func Test(t *testing.T) { TestingT(t) }
15 -
16 -type DSSuite struct{}
17 -
18 -var _ = Suite(&DSSuite{})
19 -
20 -func (ks *DSSuite) TestBasic(c *C) {
21 -
22 - mpds := ds.NewMapDatastore()
23 - nsds := ns.Wrap(mpds, ds.NewKey("abc"))
24 -
25 - keys := strsToKeys([]string{
26 - "foo",
27 - "foo/bar",
28 - "foo/bar/baz",
29 - "foo/barb",
30 - "foo/bar/bazb",
31 - "foo/bar/baz/barb",
32 - })
33 -
34 - for _, k := range keys {
35 - err := nsds.Put(k, []byte(k.String()))
36 - c.Check(err, Equals, nil)
37 - }
38 -
39 - for _, k := range keys {
40 - v1, err := nsds.Get(k)
41 - c.Check(err, Equals, nil)
42 - c.Check(bytes.Equal(v1.([]byte), []byte(k.String())), Equals, true)
43 -
44 - v2, err := mpds.Get(ds.NewKey("abc").Child(k))
45 - c.Check(err, Equals, nil)
46 - c.Check(bytes.Equal(v2.([]byte), []byte(k.String())), Equals, true)
47 - }
48 -
49 - listA, errA := mpds.KeyList()
50 - listB, errB := nsds.KeyList()
51 - c.Check(errA, Equals, nil)
52 - c.Check(errB, Equals, nil)
53 - c.Check(len(listA), Equals, len(listB))
54 -
55 - // sort them cause yeah.
56 - sort.Sort(ds.KeySlice(listA))
57 - sort.Sort(ds.KeySlice(listB))
58 -
59 - for i, kA := range listA {
60 - kB := listB[i]
61 - c.Check(nsds.InvertKey(kA), Equals, kB)
62 - c.Check(kA, Equals, nsds.ConvertKey(kB))
63 - }
64 -}
65 -
66 -func strsToKeys(strs []string) []ds.Key {
67 - keys := make([]ds.Key, len(strs))
68 - for i, s := range strs {
69 - keys[i] = ds.NewKey(s)
70 - }
71 - return keys
72 -}
net/handshake/pb/handshake.pb.go
+1 -1
@@ -14,7 +14,7 @@ It has these top-level messages:
14 */
15 package handshake_pb
16
17 -import proto "code.google.com/p/gogoprotobuf/proto"
17 +import proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/gogoprotobuf/proto"
18 import json "encoding/json"
19 import math "math"
20