use micre v3 registry interface
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListAccountsWithConfig(cfg),
|
Flags: flagset.ListAccountsWithConfig(cfg),
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := *registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.GRPC.Namespace + "." + cfg.Server.Name)
|
services, err := reg.GetService(cfg.GRPC.Namespace + "." + cfg.Server.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(fmt.Errorf("could not get accounts services from the registry: %v", err))
|
fmt.Println(fmt.Errorf("could not get accounts services from the registry: %v", err))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListIDPWithConfig(cfg),
|
Flags: flagset.ListIDPWithConfig(cfg),
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := *registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(fmt.Errorf("could not get idp services from the registry: %v", err))
|
fmt.Println(fmt.Errorf("could not get idp services from the registry: %v", err))
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ func NewService(opts ...Option) Service {
|
|||||||
micro.Version(sopts.Version),
|
micro.Version(sopts.Version),
|
||||||
micro.Context(sopts.Context),
|
micro.Context(sopts.Context),
|
||||||
micro.Flags(sopts.Flags...),
|
micro.Flags(sopts.Flags...),
|
||||||
micro.Registry(*registry.GetRegistry()),
|
micro.Registry(registry.GetRegistry()),
|
||||||
micro.RegisterTTL(time.Second * 30),
|
micro.RegisterTTL(time.Second * 30),
|
||||||
micro.RegisterInterval(time.Second * 10),
|
micro.RegisterInterval(time.Second * 10),
|
||||||
micro.WrapHandler(prometheus.NewHandlerWrapper()),
|
micro.WrapHandler(prometheus.NewHandlerWrapper()),
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ func NewService(opts ...Option) Service {
|
|||||||
micro.Version(sopts.Version),
|
micro.Version(sopts.Version),
|
||||||
micro.Context(sopts.Context),
|
micro.Context(sopts.Context),
|
||||||
micro.Flags(sopts.Flags...),
|
micro.Flags(sopts.Flags...),
|
||||||
micro.Registry(*registry.GetRegistry()),
|
micro.Registry(registry.GetRegistry()),
|
||||||
micro.RegisterTTL(time.Second * 30),
|
micro.RegisterTTL(time.Second * 30),
|
||||||
micro.RegisterInterval(time.Second * 10),
|
micro.RegisterInterval(time.Second * 10),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ func Execute() error {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
//r := *registry.GetRegistry()
|
//r := registry.GetRegistry()
|
||||||
|
|
||||||
//opts := micro.Options{
|
//opts := micro.Options{
|
||||||
// Registry: r,
|
// Registry: r,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func VersionCommand(cfg *config.Config) *cli.Command {
|
|||||||
Usage: "Lists running services with version",
|
Usage: "Lists running services with version",
|
||||||
Category: "Runtime",
|
Category: "Runtime",
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := *registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
serviceList, err := reg.ListServices()
|
serviceList, err := reg.ListServices()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(fmt.Errorf("could not list services: %v", err))
|
fmt.Println(fmt.Errorf("could not list services: %v", err))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListOcsWithConfig(cfg),
|
Flags: flagset.ListOcsWithConfig(cfg),
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := *registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(fmt.Errorf("could not get ocs services from the registry: %v", err))
|
fmt.Println(fmt.Errorf("could not get ocs services from the registry: %v", err))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListProxyWithConfig(cfg),
|
Flags: flagset.ListProxyWithConfig(cfg),
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := *registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(fmt.Errorf("could not get proxy services from the registry: %v", err))
|
fmt.Println(fmt.Errorf("could not get proxy services from the registry: %v", err))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListSettingsWithConfig(cfg),
|
Flags: flagset.ListSettingsWithConfig(cfg),
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := *registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.GRPC.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.GRPC.Namespace + "." + cfg.Service.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(fmt.Errorf("could not get settings services from the registry: %v", err))
|
fmt.Println(fmt.Errorf("could not get settings services from the registry: %v", err))
|
||||||
|
|||||||
+3
-3
@@ -19,14 +19,14 @@ func RegisterGRPCEndpoint(ctx context.Context, serviceID, uuid, addr string, log
|
|||||||
Address: addr,
|
Address: addr,
|
||||||
Metadata: make(map[string]string),
|
Metadata: make(map[string]string),
|
||||||
}
|
}
|
||||||
|
r := oregistry.GetRegistry()
|
||||||
|
|
||||||
node.Metadata["broker"] = broker.String()
|
node.Metadata["broker"] = broker.String()
|
||||||
node.Metadata["registry"] = registry.String()
|
node.Metadata["registry"] = r.String()
|
||||||
node.Metadata["server"] = "grpc"
|
node.Metadata["server"] = "grpc"
|
||||||
node.Metadata["transport"] = "grpc"
|
node.Metadata["transport"] = "grpc"
|
||||||
node.Metadata["protocol"] = "grpc"
|
node.Metadata["protocol"] = "grpc"
|
||||||
|
|
||||||
r := *oregistry.GetRegistry()
|
|
||||||
|
|
||||||
service := ®istry.Service{
|
service := ®istry.Service{
|
||||||
Name: serviceID,
|
Name: serviceID,
|
||||||
Version: "",
|
Version: "",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListStoreWithConfig(cfg),
|
Flags: flagset.ListStoreWithConfig(cfg),
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := *registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(fmt.Errorf("could not get store services from the registry: %v", err))
|
fmt.Println(fmt.Errorf("could not get store services from the registry: %v", err))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListThumbnailsWithConfig(cfg),
|
Flags: flagset.ListThumbnailsWithConfig(cfg),
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := *registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Server.Namespace + "." + cfg.Server.Name)
|
services, err := reg.GetService(cfg.Server.Namespace + "." + cfg.Server.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(fmt.Errorf("could not get thumbnails services from the registry: %v", err))
|
fmt.Println(fmt.Errorf("could not get thumbnails services from the registry: %v", err))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListWebdavWithConfig(cfg),
|
Flags: flagset.ListWebdavWithConfig(cfg),
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := *registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(fmt.Errorf("could not get webdav services from the registry: %v", err))
|
fmt.Println(fmt.Errorf("could not get webdav services from the registry: %v", err))
|
||||||
|
|||||||
Reference in New Issue
Block a user