Skip to content

Commit 6d31a6c

Browse files
committed
Moving to protobuf instead, perhaps
1 parent b4f1008 commit 6d31a6c

File tree

4 files changed

+625
-3
lines changed

4 files changed

+625
-3
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ authors = ["Ross Schulman <ross@rbs.io>"]
55

66
[dependencies]
77
hyper = "*"
8-
serde = "0.4.3"
8+
9+
[dependencies.protobuf]
10+
git = "https://github.com/stepancheg/rust-protobuf.git"

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
extern crate hyper;
2-
extern crate serde;
2+
extern crate protobuf;
3+
4+
mod merkledag;
35

46
use std::io::Read;
57

68
use hyper::Client;
79
use hyper::header::Connection;
8-
use serde::json::{self, Value};
910

1011
#[derive(Debug)]
1112
pub enum IPFSError {

src/merkledag.proto

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package merkledag.pb;
2+
3+
4+
// An IPFS MerkleDAG Link
5+
message PBLink {
6+
7+
// multihash of the target object
8+
optional bytes Hash = 1;
9+
10+
// utf string name. should be unique per object
11+
optional string Name = 2;
12+
13+
// cumulative size of target object
14+
optional uint64 Tsize = 3;
15+
}
16+
17+
// An IPFS MerkleDAG Node
18+
message PBNode {
19+
20+
// refs to other objects
21+
repeated PBLink Links = 2;
22+
23+
// opaque user data
24+
optional bytes Data = 1;
25+
}

0 commit comments

Comments
 (0)