Show readonly commands in gateway readonly API
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
rht committed
Aug 16, 2015 at 07:00 UTC
e4dbec59cf43de7f4c74bfe9b87b9f34578c1f06
1 file changed
+7
-3
core/commands/root.go
+7
-3
@@ -109,6 +109,12 @@ var rootSubcommands = map[string]*cmds.Command{
109
"version": VersionCmd,
110
"bitswap": BitswapCmd,
111
}
112
+
113
+// RootRO is the readonly version of Root
114
+var RootRO = &cmds.Command{}
115
+
116
+var CommandsDaemonROCmd = CommandsCmd(RootRO)
117
+
118
var rootROSubcommands = map[string]*cmds.Command{
119
"block": &cmds.Command{
120
Subcommands: map[string]*cmds.Command{
@@ -117,7 +123,7 @@ var rootROSubcommands = map[string]*cmds.Command{
123
},
124
},
125
"cat": CatCmd,
120
- "commands": CommandsDaemonCmd,
126
+ "commands": CommandsDaemonROCmd,
127
"ls": LsCmd,
128
"name": &cmds.Command{
129
Subcommands: map[string]*cmds.Command{
@@ -136,8 +142,6 @@ var rootROSubcommands = map[string]*cmds.Command{
142
//"resolve": ResolveCmd,
143
}
144
139
-var RootRO = &cmds.Command{}
140
-
145
func init() {
146
*RootRO = *Root
147
Root.Subcommands = rootSubcommands