master
go 50 lines 1.27 KB
Raw
1 package objectcmd
2
3 import (
4 "errors"
5
6 cmds "github.com/ipfs/go-ipfs-cmds"
7 )
8
9 type Link struct {
10 Name, Hash string
11 Size uint64
12 }
13
14 type Object struct {
15 Hash string `json:"Hash,omitempty"`
16 Links []Link `json:"Links,omitempty"`
17 }
18
19 var ErrDataEncoding = errors.New("unknown data field encoding")
20
21 var ObjectCmd = &cmds.Command{
22 Status: cmds.Deprecated, // https://github.com/ipfs/kubo/issues/7936
23 Helptext: cmds.HelpText{
24 Tagline: "Deprecated commands to interact with dag-pb objects. Use 'dag' or 'files' instead.",
25 ShortDescription: `
26 'ipfs object' is a legacy plumbing command used to manipulate dag-pb objects
27 directly. Deprecated, use more modern 'ipfs dag' and 'ipfs files' instead.`,
28 },
29
30 Subcommands: map[string]*cmds.Command{
31 "data": RemovedObjectCmd,
32 "diff": ObjectDiffCmd,
33 "get": RemovedObjectCmd,
34 "links": RemovedObjectCmd,
35 "new": RemovedObjectCmd,
36 "patch": ObjectPatchCmd,
37 "put": RemovedObjectCmd,
38 "stat": RemovedObjectCmd,
39 },
40 }
41
42 var RemovedObjectCmd = &cmds.Command{
43 Status: cmds.Removed,
44 Helptext: cmds.HelpText{
45 Tagline: "Removed, use 'ipfs dag' or 'ipfs files' instead.",
46 },
47 Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {
48 return errors.New("removed, use 'ipfs dag' or 'ipfs files' instead")
49 },
50 }