Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type FsckOutput struct {
- result string
- }
- var RepoCmd = &cmds.Command{
- Helptext: cmds.HelpText{
- Tagline: "Manipulate the IPFS repo.",
- ShortDescription: `
- 'ipfs repo' is a plumbing command used to manipulate the repo.
- `,
- },
- Subcommands: map[string]*cmds.Command{
- "gc": repoGcCmd,
- "stat": repoStatCmd,
- "fsck": repoFsckCmd,
- },
- }
- var repoFsckCmd = &cmds.Command{
- Helptext: cmds.HelpText{
- Tagline: "Removes repo lockfiles",
- ShortDescription: `
- 'ipfs repo fsck' is a plumbing command that will remove repo lockfiles
- leveldb ~/.ipfs/datastore/LOCK and ~/.ipfs/repo.lock
- `,
- },
- Run: func(req cmds.Request, res cmds.Response) {
- res.SetOutput(&FsckOutput{
- result: "Success",
- })
- },
- Type: FsckOutput{},
- Marshalers: cmds.MarshalerMap{
- cmds.Text: func(res cmds.Response) (io.Reader, error) {
- fsck := res.Output().(*FsckOutput)
- return strings.NewReader(fsck.result), nil
- },
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement