Commit 80dc4b35 authored by Siraj Ravel's avatar Siraj Ravel

gofmt-d and golint-d

parent 07bfa3ba
...@@ -2,7 +2,6 @@ package daemon ...@@ -2,7 +2,6 @@ package daemon
import ( import (
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"io" "io"
"net" "net"
...@@ -13,14 +12,15 @@ import ( ...@@ -13,14 +12,15 @@ import (
u "github.com/jbenet/go-ipfs/util" 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 { type DaemonListener struct {
node *core.IpfsNode node *core.IpfsNode
list net.Listener list net.Listener
closed bool closed bool
} }
//Command accepts user input and can be sent to the running IPFS node
type Command struct { type Command struct {
Command string Command string
Args []string Args []string
......
...@@ -8,8 +8,7 @@ import ( ...@@ -8,8 +8,7 @@ import (
"time" "time"
) )
//SendCommand connects to the address on the network with a timeout and encodes the connection into JSON
//connects to the address on the network with a timeout and encodes the connection into JSON
func SendCommand(command *Command, server string) error { func SendCommand(command *Command, server string) error {
conn, err := net.DialTimeout("tcp", server, time.Millisecond*300) conn, err := net.DialTimeout("tcp", server, time.Millisecond*300)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment