From 40e423d6dcae8dd6fa3edbe3d639c0ddce9752a3 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Thu, 28 May 2015 13:53:11 -0700 Subject: [PATCH] implement an ipfs patch command for modifying merkledag objects WIP: object creator command better docs move patch command into object namespace dont ignore cancel funcs addressing comment from CR add two new subcommands to object patch and clean up main Run func cancel contexts in early returns switch to util.Key --- core/commands/object.go | 287 ++++++++++++++++++++++++++++++++++++++- routing/record/record.go | 2 + 2 files changed, 284 insertions(+), 5 deletions(-) diff --git a/core/commands/object.go b/core/commands/object.go index 7ce9bd6b4..4e284545f 100644 --- a/core/commands/object.go +++ b/core/commands/object.go @@ -9,13 +9,18 @@ import ( "io/ioutil" "strings" "text/tabwriter" + "time" mh "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash" + context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" + key "github.com/ipfs/go-ipfs/blocks/key" cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" dag "github.com/ipfs/go-ipfs/merkledag" path "github.com/ipfs/go-ipfs/path" + ft "github.com/ipfs/go-ipfs/unixfs" + u "github.com/ipfs/go-ipfs/util" ) // ErrObjectTooLarge is returned when too much data was read from stdin. current limit 512k @@ -45,11 +50,13 @@ var ObjectCmd = &cmds.Command{ 'ipfs object' is a plumbing command used to manipulate DAG objects directly.`, Synopsis: ` -ipfs object get - Get the DAG node named by -ipfs object put - Stores input, outputs its key -ipfs object data - Outputs raw bytes in an object -ipfs object links - Outputs links pointed to by object -ipfs object stat - Outputs statistics of object +ipfs object get - Get the DAG node named by +ipfs object put - Stores input, outputs its key +ipfs object data - Outputs raw bytes in an object +ipfs object links - Outputs links pointed to by object +ipfs object stat - Outputs statistics of object +ipfs object new