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-unixfs
Commits
07bfa3ba
Commit
07bfa3ba
authored
Sep 10, 2014
by
Siraj Ravel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed uppercase
parent
4f7856a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
daemon/daemon.go
daemon/daemon.go
+10
-10
No files found.
daemon/daemon.go
View file @
07bfa3ba
...
...
@@ -27,7 +27,7 @@ type Command struct {
Opts
map
[
string
]
interface
{}
}
func
NewDaemonListener
(
I
pfsnode
*
core
.
IpfsNode
,
addr
string
)
(
*
DaemonListener
,
error
)
{
func
NewDaemonListener
(
i
pfsnode
*
core
.
IpfsNode
,
addr
string
)
(
*
DaemonListener
,
error
)
{
list
,
err
:=
net
.
Listen
(
"tcp"
,
addr
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -35,7 +35,7 @@ func NewDaemonListener(Ipfsnode *core.IpfsNode, addr string) (*DaemonListener, e
fmt
.
Println
(
"New daemon listener initialized."
)
return
&
DaemonListener
{
node
:
I
pfsnode
,
node
:
i
pfsnode
,
list
:
list
,
},
nil
}
...
...
@@ -77,7 +77,7 @@ func (dl *DaemonListener) handleConnection(conn net.Conn) {
ExecuteCommand
(
&
command
,
dl
.
node
,
conn
)
}
func
ExecuteCommand
(
com
*
Command
,
I
pfsnode
*
core
.
IpfsNode
,
out
io
.
Writer
)
{
func
ExecuteCommand
(
com
*
Command
,
i
pfsnode
*
core
.
IpfsNode
,
out
io
.
Writer
)
{
u
.
DOut
(
"executing command: %s
\n
"
,
com
.
Command
)
switch
com
.
Command
{
case
"add"
:
...
...
@@ -86,7 +86,7 @@ func ExecuteCommand(com *Command, Ipfsnode *core.IpfsNode, out io.Writer) {
depth
=
-
1
}
for
_
,
path
:=
range
com
.
Args
{
_
,
err
:=
commands
.
AddPath
(
I
pfsnode
,
path
,
depth
)
_
,
err
:=
commands
.
AddPath
(
i
pfsnode
,
path
,
depth
)
if
err
!=
nil
{
fmt
.
Fprintf
(
out
,
"addFile error: %v
\n
"
,
err
)
continue
...
...
@@ -94,13 +94,13 @@ func ExecuteCommand(com *Command, Ipfsnode *core.IpfsNode, out io.Writer) {
}
case
"cat"
:
for
_
,
fn
:=
range
com
.
Args
{
DAG
node
,
err
:=
I
pfsnode
.
Resolver
.
ResolvePath
(
fn
)
dag
node
,
err
:=
i
pfsnode
.
Resolver
.
ResolvePath
(
fn
)
if
err
!=
nil
{
fmt
.
Fprintf
(
out
,
"catFile error: %v
\n
"
,
err
)
return
}
read
,
err
:=
dag
.
NewDagReader
(
n
d
,
I
pfsnode
.
DAG
)
read
,
err
:=
dag
.
NewDagReader
(
d
agnode
,
i
pfsnode
.
DAG
)
if
err
!=
nil
{
fmt
.
Fprintln
(
out
,
err
)
continue
...
...
@@ -114,25 +114,25 @@ func ExecuteCommand(com *Command, Ipfsnode *core.IpfsNode, out io.Writer) {
}
case
"ls"
:
for
_
,
fn
:=
range
com
.
Args
{
DAG
node
,
err
:=
n
.
Resolver
.
ResolvePath
(
fn
)
dag
node
,
err
:=
ipfsnode
.
Resolver
.
ResolvePath
(
fn
)
if
err
!=
nil
{
fmt
.
Fprintf
(
out
,
"ls error: %v
\n
"
,
err
)
return
}
for
_
,
link
:=
range
n
d
.
Links
{
for
_
,
link
:=
range
d
agnode
.
Links
{
fmt
.
Fprintf
(
out
,
"%s %d %s
\n
"
,
link
.
Hash
.
B58String
(),
link
.
Size
,
link
.
Name
)
}
}
case
"pin"
:
for
_
,
fn
:=
range
com
.
Args
{
DAG
node
,
err
:=
I
pfsnode
.
Resolver
.
ResolvePath
(
fn
)
dag
node
,
err
:=
i
pfsnode
.
Resolver
.
ResolvePath
(
fn
)
if
err
!=
nil
{
fmt
.
Fprintf
(
out
,
"pin error: %v
\n
"
,
err
)
return
}
err
=
I
pfsnode
.
PinDagNode
(
n
d
)
err
=
i
pfsnode
.
PinDagNode
(
d
agnode
)
if
err
!=
nil
{
fmt
.
Fprintf
(
out
,
"pin: %v
\n
"
,
err
)
return
...
...
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