package commands import ( "bytes" "encoding/json" "errors" "fmt" "io" "io/ioutil" "strings" "text/tabwriter" mh "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash" 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" dagutils "github.com/ipfs/go-ipfs/merkledag/utils" 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 var ErrObjectTooLarge = errors.New("input object was too large. limit is 512kbytes") const inputLimit = 512 * 1024 type Node struct { Links []Link Data string } type Link struct { Name, Hash string Size uint64 } type Object struct { Hash string Links []Link } var ObjectCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Interact with ipfs objects", ShortDescription: ` '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 new