提交 488515c2 作者: Brian Tiger Chow

refactor(namesys) move proto to internal pb package

上级 a8175316
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
mh "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash" mh "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
ci "github.com/jbenet/go-ipfs/crypto" ci "github.com/jbenet/go-ipfs/crypto"
pb "github.com/jbenet/go-ipfs/namesys/internal/pb"
routing "github.com/jbenet/go-ipfs/routing" routing "github.com/jbenet/go-ipfs/routing"
u "github.com/jbenet/go-ipfs/util" u "github.com/jbenet/go-ipfs/util"
) )
...@@ -67,7 +68,7 @@ func (p *ipnsPublisher) Publish(k ci.PrivKey, value string) error { ...@@ -67,7 +68,7 @@ func (p *ipnsPublisher) Publish(k ci.PrivKey, value string) error {
} }
func createRoutingEntryData(pk ci.PrivKey, val string) ([]byte, error) { func createRoutingEntryData(pk ci.PrivKey, val string) ([]byte, error) {
entry := new(IpnsEntry) entry := new(pb.IpnsEntry)
sig, err := pk.Sign([]byte(val)) sig, err := pk.Sign([]byte(val))
if err != nil { if err != nil {
return nil, err return nil, err
......
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
mh "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash" mh "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
ci "github.com/jbenet/go-ipfs/crypto" ci "github.com/jbenet/go-ipfs/crypto"
pb "github.com/jbenet/go-ipfs/namesys/internal/pb"
routing "github.com/jbenet/go-ipfs/routing" routing "github.com/jbenet/go-ipfs/routing"
u "github.com/jbenet/go-ipfs/util" u "github.com/jbenet/go-ipfs/util"
) )
...@@ -54,7 +55,7 @@ func (r *routingResolver) Resolve(name string) (string, error) { ...@@ -54,7 +55,7 @@ func (r *routingResolver) Resolve(name string) (string, error) {
return "", err return "", err
} }
entry := new(IpnsEntry) entry := new(pb.IpnsEntry)
err = proto.Unmarshal(val, entry) err = proto.Unmarshal(val, entry)
if err != nil { if err != nil {
return "", err return "", err
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论