Skip to content

Commit

Permalink
Merge pull request #5356 from ipfs/feat/protobuf-2
Browse files Browse the repository at this point in the history
update protobuf files in go-ipfs
  • Loading branch information
Stebalien authored Aug 15, 2018
2 parents 3d1802f + c80b418 commit f6ba685
Show file tree
Hide file tree
Showing 11 changed files with 709 additions and 129 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

SHELL=PATH='$(PATH)' /bin/sh

PROTOC = protoc --gogo_out=. --proto_path=.:/usr/local/opt/protobuf/include:$(dir $@) $<
PROTOC = protoc --gogofaster_out=. --proto_path=.:$(GOPATH)/src:$(dir $@) $<

# enable second expansion
.SECONDEXPANSION:
Expand Down
3 changes: 3 additions & 0 deletions Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ endif
dir := pin/internal/pb
include $(dir)/Rules.mk

dir := filestore/pb
include $(dir)/Rules.mk


# -------------------- #
# universal rules #
Expand Down
10 changes: 5 additions & 5 deletions filestore/fsrefstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
dsq "gx/ipfs/QmVG5gxteQNEMhrS8prJSmU2C9rebtFuTd3SYZ5kE3YZ5k/go-datastore/query"
blockstore "gx/ipfs/QmYBEfMSquSGnuxBthUoBJNs3F6p4VAPPvAgxq6XXGvTPh/go-ipfs-blockstore"
cid "gx/ipfs/QmYjnkEL7i731PirfVH1sis89evN7jt4otSHw5D2xXXwUV/go-cid"
proto "gx/ipfs/QmZHU2gx42NPTYXzw6pJkuX6xCE7bKECp6e8QcPdoLx8sx/protobuf/proto"
posinfo "gx/ipfs/QmdBpJ5VTfL79VwKDU93z7fyZJ3mm4UaBHrE73CWRw2Bjd/go-ipfs-posinfo"
proto "gx/ipfs/QmdxUuburamoF6zF9qjeQC4WYcWGbWuRmdLacMEsW8ioD8/gogo-protobuf/proto"
)

// FilestorePrefix identifies the key prefix for FileManager blocks.
Expand Down Expand Up @@ -276,7 +276,7 @@ func (f *FileManager) putTo(b *posinfo.FilestoreNode, to putter) error {
if !f.AllowUrls {
return ErrUrlstoreNotEnabled
}
dobj.FilePath = proto.String(b.PosInfo.FullPath)
dobj.FilePath = b.PosInfo.FullPath
} else {
if !f.AllowFiles {
return ErrFilestoreNotEnabled
Expand All @@ -290,10 +290,10 @@ func (f *FileManager) putTo(b *posinfo.FilestoreNode, to putter) error {
return err
}

dobj.FilePath = proto.String(filepath.ToSlash(p))
dobj.FilePath = filepath.ToSlash(p)
}
dobj.Offset = proto.Uint64(b.PosInfo.Offset)
dobj.Size_ = proto.Uint64(uint64(len(b.RawData())))
dobj.Offset = b.PosInfo.Offset
dobj.Size_ = uint64(len(b.RawData()))

data, err := proto.Marshal(&dobj)
if err != nil {
Expand Down
10 changes: 0 additions & 10 deletions filestore/pb/Makefile

This file was deleted.

8 changes: 8 additions & 0 deletions filestore/pb/Rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include mk/header.mk

PB_$(d) = $(wildcard $(d)/*.proto)
TGTS_$(d) = $(PB_$(d):.proto=.pb.go)

#DEPS_GO += $(TGTS_$(d))

include mk/footer.mk
Loading

0 comments on commit f6ba685

Please sign in to comment.