Clean up rpc.go file
This commit is contained in:
parent
44e04ef998
commit
d248260789
1 changed files with 5 additions and 1 deletions
|
@ -2,19 +2,24 @@ package queue
|
||||||
|
|
||||||
import "errors"
|
import "errors"
|
||||||
|
|
||||||
|
// RPCReq contains information for communicating with the RPC server
|
||||||
type RPCReq struct {
|
type RPCReq struct {
|
||||||
method string
|
method string
|
||||||
replyChan chan interface{}
|
replyChan chan interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RPCResponse holds the response
|
||||||
type RPCResponse string
|
type RPCResponse string
|
||||||
|
|
||||||
|
// Status contains RPC request information
|
||||||
type Status struct {
|
type Status struct {
|
||||||
queueChan chan RPCReq
|
queueChan chan RPCReq
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RPCArgs arg information for the RPC server
|
||||||
type RPCArgs struct{}
|
type RPCArgs struct{}
|
||||||
|
|
||||||
|
// Downloads gets download statuses
|
||||||
func (s *Status) Downloads(_ RPCArgs, reply *RPCResponse) error {
|
func (s *Status) Downloads(_ RPCArgs, reply *RPCResponse) error {
|
||||||
replyChan := make(chan interface{})
|
replyChan := make(chan interface{})
|
||||||
req := RPCReq{
|
req := RPCReq{
|
||||||
|
@ -31,7 +36,6 @@ func (s *Status) Downloads(_ RPCArgs, reply *RPCResponse) error {
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
return errors.New("error: unexpected return value")
|
return errors.New("error: unexpected return value")
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue