From 1208d736c479be0d54acb55028d07cdcd541e2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 18 Dec 2018 14:23:55 +0100 Subject: [PATCH] coreapi/unixfs: Use path instead of raw hash in AddEvent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Ɓukasz Magiera This commit was moved from ipfs/interface-go-ipfs-core@a1cf89b78a61aef35a4893f916e14e39cd5c9157 This commit was moved from ipfs/boxo@b5e06d34876da3759fa39fb18f557085e27f76d0 --- core/coreiface/path.go | 1 + core/coreiface/unixfs.go | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/coreiface/path.go b/core/coreiface/path.go index 57ef4c21b..01dda97d5 100644 --- a/core/coreiface/path.go +++ b/core/coreiface/path.go @@ -46,6 +46,7 @@ type ResolvedPath interface { // cidRoot := {"A": {"/": cidA }} // // And resolve paths: + // // * "/ipfs/${cidRoot}" // * Calling Cid() will return `cidRoot` // * Calling Root() will return `cidRoot` diff --git a/core/coreiface/unixfs.go b/core/coreiface/unixfs.go index 589083c6b..b42b454cc 100644 --- a/core/coreiface/unixfs.go +++ b/core/coreiface/unixfs.go @@ -9,12 +9,11 @@ import ( ipld "gx/ipfs/QmcKKBwfz6FyQdHR2jsXrrF6XeSBXYL86anmWNewpFpoF5/go-ipld-format" ) -// TODO: ideas on making this more coreapi-ish without breaking the http API? type AddEvent struct { Name string - Hash string `json:",omitempty"` - Bytes int64 `json:",omitempty"` - Size string `json:",omitempty"` + Path ResolvedPath `json:",omitempty"` + Bytes int64 `json:",omitempty"` + Size string `json:",omitempty"` } // UnixfsAPI is the basic interface to immutable files in IPFS