list running services

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2021-03-10 15:12:50 +00:00
parent b19e739137
commit 9424caede8
2 changed files with 39 additions and 13 deletions
+18 -13
View File
@@ -1,6 +1,11 @@
package command
import (
"fmt"
"log"
"net"
"net/rpc"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
@@ -20,23 +25,23 @@ func ListCommand(cfg *config.Config) *cli.Command {
},
&cli.StringFlag{
Name: "port",
Value: "10666",
Value: "6060",
EnvVars: []string{"OCIS_RUNTIME_PORT"},
},
},
Action: func(c *cli.Context) error {
//client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Hostname, cfg.Runtime.Port))
//if err != nil {
// log.Fatal("dialing:", err)
//}
//
//var arg1 string
//
//if err := client.Call("Service.List", struct{}{}, &arg1); err != nil {
// log.Fatal(err)
//}
//
//fmt.Println(arg1)
client, err := rpc.DialHTTP("tcp", net.JoinHostPort("localhost", "6060"))
if err != nil {
log.Fatal("dialing:", err)
}
var arg1 string
if err := client.Call("Service.List", struct{}{}, &arg1); err != nil {
log.Fatal(err)
}
fmt.Println(arg1)
return nil
},