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
aec44bc4
Commit
aec44bc4
authored
Dec 20, 2017
by
keks
Committed by
Jeromy
Jan 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use *oldcmds.Context consistently instead of non-ptr
License: MIT Signed-off-by:
keks
<
keks@cryptoscope.co
>
parent
091eeee2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
cmd/ipfs/daemon.go
cmd/ipfs/daemon.go
+2
-2
cmd/ipfswatch/main.go
cmd/ipfswatch/main.go
+2
-2
core/corehttp/commands.go
core/corehttp/commands.go
+3
-3
No files found.
cmd/ipfs/daemon.go
View file @
aec44bc4
...
...
@@ -432,7 +432,7 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (error, <-chan error
var
opts
=
[]
corehttp
.
ServeOption
{
corehttp
.
MetricsCollectionOption
(
"api"
),
corehttp
.
CheckVersionOption
(),
corehttp
.
CommandsOption
(
*
cctx
),
corehttp
.
CommandsOption
(
cctx
),
corehttp
.
WebUIOption
,
gatewayOpt
,
corehttp
.
VersionOption
(),
...
...
@@ -527,7 +527,7 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (error, <-chan e
var
opts
=
[]
corehttp
.
ServeOption
{
corehttp
.
MetricsCollectionOption
(
"gateway"
),
corehttp
.
CheckVersionOption
(),
corehttp
.
CommandsROOption
(
*
cctx
),
corehttp
.
CommandsROOption
(
cctx
),
corehttp
.
VersionOption
(),
corehttp
.
IPNSHostnameOption
(),
corehttp
.
GatewayOption
(
writable
,
"/ipfs"
,
"/ipns"
),
...
...
cmd/ipfswatch/main.go
View file @
aec44bc4
...
...
@@ -186,8 +186,8 @@ func IsHidden(path string) bool {
return
false
}
func
cmdCtx
(
node
*
core
.
IpfsNode
,
repoPath
string
)
commands
.
Context
{
return
commands
.
Context
{
func
cmdCtx
(
node
*
core
.
IpfsNode
,
repoPath
string
)
*
commands
.
Context
{
return
&
commands
.
Context
{
Online
:
true
,
ConfigRoot
:
repoPath
,
LoadConfig
:
func
(
path
string
)
(
*
config
.
Config
,
error
)
{
...
...
core/corehttp/commands.go
View file @
aec44bc4
...
...
@@ -110,7 +110,7 @@ func patchCORSVars(c *cmdsHttp.ServerConfig, addr net.Addr) {
c
.
SetAllowedOrigins
(
origins
...
)
}
func
commandsOption
(
cctx
oldcmds
.
Context
,
command
*
cmds
.
Command
)
ServeOption
{
func
commandsOption
(
cctx
*
oldcmds
.
Context
,
command
*
cmds
.
Command
)
ServeOption
{
return
func
(
n
*
core
.
IpfsNode
,
l
net
.
Listener
,
mux
*
http
.
ServeMux
)
(
*
http
.
ServeMux
,
error
)
{
cfg
:=
cmdsHttp
.
NewServerConfig
()
...
...
@@ -132,11 +132,11 @@ func commandsOption(cctx oldcmds.Context, command *cmds.Command) ServeOption {
}
}
func
CommandsOption
(
cctx
oldcmds
.
Context
)
ServeOption
{
func
CommandsOption
(
cctx
*
oldcmds
.
Context
)
ServeOption
{
return
commandsOption
(
cctx
,
corecommands
.
Root
)
}
func
CommandsROOption
(
cctx
oldcmds
.
Context
)
ServeOption
{
func
CommandsROOption
(
cctx
*
oldcmds
.
Context
)
ServeOption
{
return
commandsOption
(
cctx
,
corecommands
.
RootRO
)
}
...
...
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