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
80dc4b35
Commit
80dc4b35
authored
Sep 10, 2014
by
Siraj Ravel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gofmt-d and golint-d
parent
07bfa3ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
daemon/daemon.go
daemon/daemon.go
+3
-3
daemon/daemon_client.go
daemon/daemon_client.go
+4
-5
No files found.
daemon/daemon.go
View file @
80dc4b35
...
...
@@ -2,7 +2,6 @@ package daemon
import
(
"encoding/json"
"errors"
"fmt"
"io"
"net"
...
...
@@ -13,14 +12,15 @@ import (
u
"github.com/jbenet/go-ipfs/util"
)
var
ErrInvalidCommand
=
errors
.
New
(
"invalid command"
)
//DaemonListener listens to an initialized IPFS node and can send it commands instead of
//starting up a new set of connections
type
DaemonListener
struct
{
node
*
core
.
IpfsNode
list
net
.
Listener
closed
bool
}
//Command accepts user input and can be sent to the running IPFS node
type
Command
struct
{
Command
string
Args
[]
string
...
...
daemon/daemon_client.go
View file @
80dc4b35
...
...
@@ -5,15 +5,14 @@ import (
"io"
"net"
"os"
"time"
"time"
)
//connects to the address on the network with a timeout and encodes the connection into JSON
//SendCommand connects to the address on the network with a timeout and encodes the connection into JSON
func
SendCommand
(
command
*
Command
,
server
string
)
error
{
conn
,
err
:=
net
.
DialTimeout
(
"tcp"
,
server
,
time
.
Millisecond
*
300
)
if
err
!=
nil
{
return
err
}
...
...
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