Repository: threefoldtech/zos (go)

Issue:
Gedis commands need to be changed to go with the new package structure
For adding nodes:
- `tfgrid.directory.nodes` + `add`/whatever function you want to call.

For farms actors:
- `tfgrid.directory.farms` + `register`/whatever function you want to call.

For querying workloads:
- `tfgrid.workloads.workload_manager` + `workloads_list`/whatever function you want to call.

Pull request description:
Fix actor name
Fixes #443 

Patch:
diff --git a/pkg/gedis/commands_provision.go b/pkg/gedis/commands_provision.go
index 3f8e3979..9046040b 100644
--- a/pkg/gedis/commands_provision.go
+++ b/pkg/gedis/commands_provision.go
@@ -56,7 +56,7 @@ func (g *Gedis) Reserve(r *provision.Reservation, nodeID pkg.Identifier) (string
 		}
 	}
 
-	result, err := Bytes(g.Send("tfgrid.directory.workload_manager", "reservation_register", Args{
+	result, err := Bytes(g.Send("tfgrid.workloads.workload_manager", "reservation_register", Args{
 		"reservation": res,
 	}))
 
@@ -74,7 +74,7 @@ func (g *Gedis) Reserve(r *provision.Reservation, nodeID pkg.Identifier) (string
 
 // Get implements provision.ReservationGetter
 func (g *Gedis) Get(id string) (*provision.Reservation, error) {
-	result, err := Bytes(g.Send("tfgrid.directory.workload_manager", "workload_get", Args{
+	result, err := Bytes(g.Send("tfgrid.workloads.workload_manager", "workload_get", Args{
 		"gwid": id,
 	}))
 
@@ -97,7 +97,7 @@ func (g *Gedis) Get(id string) (*provision.Reservation, error) {
 // to get the reservation part.
 func (g *Gedis) Poll(nodeID pkg.Identifier, from uint64) ([]*provision.Reservation, error) {
 
-	result, err := Bytes(g.Send("tfgrid.directory.workload_manager", "workloads_list", Args{
+	result, err := Bytes(g.Send("tfgrid.workloads.workload_manager", "workloads_list", Args{
 		"node_id": nodeID.Identity(),
 		"cursor":  from,
 	}))
@@ -165,7 +165,7 @@ func (g *Gedis) Feedback(id string, r *provision.Result) error {
 		Epoch:      schema.Date{r.Created},
 	}
 
-	_, err := g.Send("tfgrid.directory.workload_manager", "set_workload_result", Args{
+	_, err := g.Send("tfgrid.workloads.workload_manager", "set_workload_result", Args{
 		"global_workload_id": id,
 		"result":             result,
 	})


Test patch:
diff --git a/pkg/gedis/commands_provision_test.go b/pkg/gedis/commands_provision_test.go
index ec7277aa..3175a00e 100644
--- a/pkg/gedis/commands_provision_test.go
+++ b/pkg/gedis/commands_provision_test.go
@@ -30,7 +30,7 @@ func TestProvisionGet(t *testing.T) {
 
 	workload := `{"workload_id": 10, "type": 0, "size": 100}`
 
-	conn.On("Do", "tfgrid.directory.workload_manager.workload_get", mustMarshal(t, args)).
+	conn.On("Do", "tfgrid.workloads.workload_manager.workload_get", mustMarshal(t, args)).
 		Return(mustMarshal(t, Args{
 			"workload_id": id,
 			"type":        types.TfgridReservationWorkload1TypeVolume,
@@ -63,7 +63,7 @@ func TestProvisionPoll(t *testing.T) {
 	workloadVol := `{"workload_id": 1, "type": 0, "size": 100}`
 	workloadZdb := `{"workload_id": 1, "mode": 0, "size": 100}`
 
-	conn.On("Do", "tfgrid.directory.workload_manager.workloads_list", mustMarshal(t, args)).
+	conn.On("Do", "tfgrid.workloads.workload_manager.workloads_list", mustMarshal(t, args)).
 		Return(mustMarshal(t, Args{
 			"workloads": []types.TfgridReservationWorkload1{
 				{
@@ -93,7 +93,7 @@ func TestProvisionPoll(t *testing.T) {
 		"cursor":  10,
 	}
 
-	conn.On("Do", "tfgrid.directory.workload_manager.workloads_list", mustMarshal(t, args)).
+	conn.On("Do", "tfgrid.workloads.workload_manager.workloads_list", mustMarshal(t, args)).
 		Return(mustMarshal(t, Args{
 			"workloads": []types.TfgridReservationWorkload1{
 				{
@@ -148,7 +148,7 @@ func TestProvisionFeedback(t *testing.T) {
 		},
 	}
 
-	conn.On("Do", "tfgrid.directory.workload_manager.set_workload_result", mustMarshal(t, args)).
+	conn.On("Do", "tfgrid.workloads.workload_manager.set_workload_result", mustMarshal(t, args)).
 		Return(nil, nil)
 
 	err := gedis.Feedback(id, &result)
@@ -197,7 +197,7 @@ func TestProvisionReserve(t *testing.T) {
 		},
 	}
 
-	conn.On("Do", "tfgrid.directory.workload_manager.reservation_register", mock.MatchedBy(func(in []byte) bool {
+	conn.On("Do", "tfgrid.workloads.workload_manager.reservation_register", mock.MatchedBy(func(in []byte) bool {
 		EqualJSON(t, mustMarshal(t, args), in)
 		return true
 	})).