rework config
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/owncloud/ocis/accounts/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/accounts/pkg/config"
|
||||
"github.com/owncloud/ocis/accounts/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"github.com/owncloud/ocis/glauth/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/glauth/pkg/config"
|
||||
"github.com/owncloud/ocis/glauth/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"github.com/owncloud/ocis/idp/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/idp/pkg/config"
|
||||
"github.com/owncloud/ocis/idp/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
@@ -20,20 +20,18 @@ func KillCommand(cfg *config.Config) *cli.Command {
|
||||
Category: "Runtime",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
Destination: &cfg.Runtime.Hostname,
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "port",
|
||||
Value: "6060",
|
||||
EnvVars: []string{"OCIS_RUNTIME_PORT"},
|
||||
Destination: &cfg.Runtime.Port,
|
||||
Name: "port",
|
||||
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))
|
||||
client, err := rpc.DialHTTP("tcp", net.JoinHostPort("localhost", "6060"))
|
||||
if err != nil {
|
||||
log.Fatal("dialing:", err)
|
||||
}
|
||||
|
||||
+19
-26
@@ -1,13 +1,8 @@
|
||||
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/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
@@ -19,31 +14,29 @@ func ListCommand(cfg *config.Config) *cli.Command {
|
||||
Category: "Runtime",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
Destination: &cfg.Runtime.Hostname,
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "port",
|
||||
Value: "10666",
|
||||
EnvVars: []string{"OCIS_RUNTIME_PORT"},
|
||||
Destination: &cfg.Runtime.Port,
|
||||
Name: "port",
|
||||
Value: "10666",
|
||||
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(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)
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/ocs/pkg/command"
|
||||
|
||||
@@ -2,7 +2,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/onlyoffice/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/onlyoffice/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/proxy/pkg/command"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
|
||||
+8
-11
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
cli "github.com/micro/cli/v2"
|
||||
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
@@ -20,21 +20,18 @@ func RunCommand(cfg *config.Config) *cli.Command {
|
||||
Category: "Runtime",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
Destination: &cfg.Runtime.Hostname,
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "port",
|
||||
Value: "6060",
|
||||
EnvVars: []string{"OCIS_RUNTIME_PORT"},
|
||||
Destination: &cfg.Runtime.Port,
|
||||
Name: "port",
|
||||
Value: "6060",
|
||||
EnvVars: []string{"OCIS_RUNTIME_PORT"},
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
// TODO(refs) this implementation changes as we don't depend on os threads anymore.
|
||||
client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Hostname, cfg.Runtime.Port))
|
||||
client, err := rpc.DialHTTP("tcp", net.JoinHostPort("localhost", "6060"))
|
||||
if err != nil {
|
||||
log.Fatal("dialing:", err)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/runtime"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/settings/pkg/command"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -2,7 +2,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/store/pkg/command"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/thumbnails/pkg/command"
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
mreg "github.com/asim/go-micro/v3/registry"
|
||||
"github.com/micro/cli/v2"
|
||||
tw "github.com/olekukonko/tablewriter"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/registry"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/web/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/web/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/webdav/pkg/command"
|
||||
|
||||
Reference in New Issue
Block a user