Compare commits

...

3 Commits

Author SHA1 Message Date
Jeromy
e5a96152bd gx publish 0.5.1 2016-10-05 11:37:05 -07:00
Jeromy
0f69fedd3a gx publish 0.5.0 2016-09-27 06:14:57 -07:00
Jeromy
595cace68a make cid's loggable 2016-09-27 06:14:46 -07:00
3 changed files with 14 additions and 8 deletions

View File

@@ -1 +1 @@
0.3.0: QmfAjb1QYA9SS9TLVJBRZXEVriGaGrRZ3vJSajhLa52aYg 0.5.1: QmUrECr5NauzkUaofvUnCFGjZ4Wevt76n79uv6BhEkuyn3

14
cid.go
View File

@@ -12,10 +12,10 @@ import (
const UnsupportedVersionString = "<unsupported cid version>" const UnsupportedVersionString = "<unsupported cid version>"
const ( const (
Protobuf = iota Protobuf = 0x70
Raw CBOR = 0x71
JSON Raw = 0x72
CBOR JSON = 0x73
) )
func NewCidV0(h mh.Multihash) *Cid { func NewCidV0(h mh.Multihash) *Cid {
@@ -168,3 +168,9 @@ func (c *Cid) MarshalJSON() ([]byte, error) {
func (c *Cid) KeyString() string { func (c *Cid) KeyString() string {
return string(c.Bytes()) return string(c.Bytes())
} }
func (c *Cid) Loggable() map[string]interface{} {
return map[string]interface{}{
"cid": c,
}
}

View File

@@ -9,9 +9,9 @@
"gxDependencies": [ "gxDependencies": [
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmYf7ng2hG5XBtJA3tN34DQ2GUN5HNksEw1rLDkmr6vGku", "hash": "QmYDds3421prZgqKbLpEK7T9Aa2eVdQ7o3YarX1LVLdP2J",
"name": "go-multihash", "name": "go-multihash",
"version": "0.0.0" "version": "1.0.0"
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
@@ -25,6 +25,6 @@
"license": "", "license": "",
"name": "go-cid", "name": "go-cid",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"", "releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "0.3.0" "version": "0.5.1"
} }