Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
8cad2d2c
Commit
8cad2d2c
authored
May 26, 2015
by
rht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move 'tour' to core/commands
Side effect: this makes 'tour' accessible through the HTTP API
parent
4e71ce3c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
cmd/ipfs/ipfs.go
cmd/ipfs/ipfs.go
+0
-1
core/commands/root.go
core/commands/root.go
+1
-0
core/commands/tour.go
core/commands/tour.go
+5
-5
core/commands/tour_test.go
core/commands/tour_test.go
+1
-1
No files found.
cmd/ipfs/ipfs.go
View file @
8cad2d2c
...
...
@@ -23,7 +23,6 @@ var commandsClientCmd = commands.CommandsCmd(Root)
var
localCommands
=
map
[
string
]
*
cmds
.
Command
{
"daemon"
:
daemonCmd
,
"init"
:
initCmd
,
"tour"
:
tourCmd
,
"commands"
:
commandsClientCmd
,
}
var
localMap
=
make
(
map
[
*
cmds
.
Command
]
bool
)
...
...
core/commands/root.go
View file @
8cad2d2c
...
...
@@ -101,6 +101,7 @@ var rootSubcommands = map[string]*cmds.Command{
"resolve"
:
ResolveCmd
,
"stats"
:
StatsCmd
,
"swarm"
:
SwarmCmd
,
"tour"
:
tourCmd
,
"update"
:
UpdateCmd
,
"version"
:
VersionCmd
,
"bitswap"
:
BitswapCmd
,
...
...
c
md/ipf
s/tour.go
→
c
ore/command
s/tour.go
View file @
8cad2d2c
package
main
package
commands
import
(
"bytes"
"fmt"
"html/template"
"io"
"os"
cmds
"github.com/ipfs/go-ipfs/commands"
config
"github.com/ipfs/go-ipfs/repo/config"
...
...
@@ -50,7 +49,6 @@ func tourRunFunc(req cmds.Request, res cmds.Response) {
}
var
w
bytes
.
Buffer
defer
w
.
WriteTo
(
os
.
Stdout
)
t
,
err
:=
tourGet
(
id
)
if
err
!=
nil
{
...
...
@@ -64,11 +62,13 @@ func tourRunFunc(req cmds.Request, res cmds.Response) {
fmt
.
Fprintln
(
&
w
,
err
)
fmt
.
Fprintln
(
&
w
,
""
)
fprintTourList
(
&
w
,
tour
.
TopicID
(
cfg
.
Tour
.
Last
))
res
.
SetOutput
(
bytes
.
NewReader
(
w
.
Bytes
()))
return
}
fprintTourShow
(
&
w
,
t
)
res
.
SetOutput
(
bytes
.
NewReader
(
w
.
Bytes
()))
}
var
cmdIpfsTourNext
=
&
cmds
.
Command
{
...
...
@@ -106,7 +106,7 @@ var cmdIpfsTourNext = &cmds.Command{
}
}
w
.
WriteTo
(
os
.
Stdout
)
res
.
SetOutput
(
bytes
.
NewReader
(
w
.
Bytes
())
)
},
}
...
...
@@ -146,7 +146,7 @@ var cmdIpfsTourList = &cmds.Command{
var
w
bytes
.
Buffer
fprintTourList
(
&
w
,
tour
.
TopicID
(
cfg
.
Tour
.
Last
))
w
.
WriteTo
(
os
.
Stdout
)
res
.
SetOutput
(
bytes
.
NewReader
(
w
.
Bytes
())
)
},
}
...
...
c
md/ipf
s/tour_test.go
→
c
ore/command
s/tour_test.go
View file @
8cad2d2c
package
main
package
commands
import
(
"bytes"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment