Skip to content

Commit f6ba685

Browse files
authored
Merge pull request #5356 from ipfs/feat/protobuf-2
update protobuf files in go-ipfs
2 parents 3d1802f + c80b418 commit f6ba685

File tree

11 files changed

+709
-129
lines changed

11 files changed

+709
-129
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

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

77
# enable second expansion
88
.SECONDEXPANSION:

Rules.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ endif
5050
dir := pin/internal/pb
5151
include $(dir)/Rules.mk
5252

53+
dir := filestore/pb
54+
include $(dir)/Rules.mk
55+
5356

5457
# -------------------- #
5558
# universal rules #

filestore/fsrefstore.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import (
1717
dsq "gx/ipfs/QmVG5gxteQNEMhrS8prJSmU2C9rebtFuTd3SYZ5kE3YZ5k/go-datastore/query"
1818
blockstore "gx/ipfs/QmYBEfMSquSGnuxBthUoBJNs3F6p4VAPPvAgxq6XXGvTPh/go-ipfs-blockstore"
1919
cid "gx/ipfs/QmYjnkEL7i731PirfVH1sis89evN7jt4otSHw5D2xXXwUV/go-cid"
20-
proto "gx/ipfs/QmZHU2gx42NPTYXzw6pJkuX6xCE7bKECp6e8QcPdoLx8sx/protobuf/proto"
2120
posinfo "gx/ipfs/QmdBpJ5VTfL79VwKDU93z7fyZJ3mm4UaBHrE73CWRw2Bjd/go-ipfs-posinfo"
21+
proto "gx/ipfs/QmdxUuburamoF6zF9qjeQC4WYcWGbWuRmdLacMEsW8ioD8/gogo-protobuf/proto"
2222
)
2323

2424
// FilestorePrefix identifies the key prefix for FileManager blocks.
@@ -276,7 +276,7 @@ func (f *FileManager) putTo(b *posinfo.FilestoreNode, to putter) error {
276276
if !f.AllowUrls {
277277
return ErrUrlstoreNotEnabled
278278
}
279-
dobj.FilePath = proto.String(b.PosInfo.FullPath)
279+
dobj.FilePath = b.PosInfo.FullPath
280280
} else {
281281
if !f.AllowFiles {
282282
return ErrFilestoreNotEnabled
@@ -290,10 +290,10 @@ func (f *FileManager) putTo(b *posinfo.FilestoreNode, to putter) error {
290290
return err
291291
}
292292

293-
dobj.FilePath = proto.String(filepath.ToSlash(p))
293+
dobj.FilePath = filepath.ToSlash(p)
294294
}
295-
dobj.Offset = proto.Uint64(b.PosInfo.Offset)
296-
dobj.Size_ = proto.Uint64(uint64(len(b.RawData())))
295+
dobj.Offset = b.PosInfo.Offset
296+
dobj.Size_ = uint64(len(b.RawData()))
297297

298298
data, err := proto.Marshal(&dobj)
299299
if err != nil {

filestore/pb/Makefile

Lines changed: 0 additions & 10 deletions
This file was deleted.

filestore/pb/Rules.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include mk/header.mk
2+
3+
PB_$(d) = $(wildcard $(d)/*.proto)
4+
TGTS_$(d) = $(PB_$(d):.proto=.pb.go)
5+
6+
#DEPS_GO += $(TGTS_$(d))
7+
8+
include mk/footer.mk

0 commit comments

Comments
 (0)