Advertisement
Guest User

Untitled

a guest
Apr 20th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. type FsckOutput struct {
  2. result string
  3. }
  4.  
  5. var RepoCmd = &cmds.Command{
  6. Helptext: cmds.HelpText{
  7. Tagline: "Manipulate the IPFS repo.",
  8. ShortDescription: `
  9. 'ipfs repo' is a plumbing command used to manipulate the repo.
  10. `,
  11. },
  12.  
  13. Subcommands: map[string]*cmds.Command{
  14. "gc": repoGcCmd,
  15. "stat": repoStatCmd,
  16. "fsck": repoFsckCmd,
  17. },
  18. }
  19.  
  20. var repoFsckCmd = &cmds.Command{
  21. Helptext: cmds.HelpText{
  22. Tagline: "Removes repo lockfiles",
  23. ShortDescription: `
  24. 'ipfs repo fsck' is a plumbing command that will remove repo lockfiles
  25. leveldb ~/.ipfs/datastore/LOCK and ~/.ipfs/repo.lock
  26. `,
  27. },
  28. Run: func(req cmds.Request, res cmds.Response) {
  29. res.SetOutput(&FsckOutput{
  30. result: "Success",
  31. })
  32. },
  33. Type: FsckOutput{},
  34. Marshalers: cmds.MarshalerMap{
  35. cmds.Text: func(res cmds.Response) (io.Reader, error) {
  36. fsck := res.Output().(*FsckOutput)
  37. return strings.NewReader(fsck.result), nil
  38. },
  39. },
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement