Skip to content

Commit

Permalink
strip runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Jul 7, 2024
1 parent 29d79d7 commit 3676232
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
1 change: 0 additions & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"go-micro.dev/v5/debug/trace"
"go-micro.dev/v5/logger"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/runtime"
"go-micro.dev/v5/selector"
"go-micro.dev/v5/server"
"go-micro.dev/v5/store"
Expand Down
31 changes: 0 additions & 31 deletions util/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"go-micro.dev/v5/debug/trace"
"go-micro.dev/v5/logger"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/runtime"
"go-micro.dev/v5/selector"
"go-micro.dev/v5/server"
"go-micro.dev/v5/store"
Expand Down Expand Up @@ -146,17 +145,6 @@ var (
EnvVars: []string{"MICRO_REGISTRY_ADDRESS"},
Usage: "Comma-separated list of registry addresses",
},
&cli.StringFlag{
Name: "runtime",
Usage: "Runtime for building and running services e.g local, kubernetes",
EnvVars: []string{"MICRO_RUNTIME"},
},
&cli.StringFlag{
Name: "runtime_source",
Usage: "Runtime source for building and running services e.g github.com/micro/service",
EnvVars: []string{"MICRO_RUNTIME_SOURCE"},
Value: "github.com/micro/services",
},
&cli.StringFlag{
Name: "selector",
EnvVars: []string{"MICRO_SELECTOR"},
Expand Down Expand Up @@ -252,8 +240,6 @@ var (

DefaultTransports = map[string]func(...transport.Option) transport.Transport{}

DefaultRuntimes = map[string]func(...runtime.Option) runtime.Runtime{}

DefaultStores = map[string]func(...store.Option) store.Store{}

DefaultTracers = map[string]func(...trace.Option) trace.Tracer{}
Expand Down Expand Up @@ -283,7 +269,6 @@ func newCmd(opts ...Option) Cmd {
Server: &server.DefaultServer,
Selector: &selector.DefaultSelector,
Transport: &transport.DefaultTransport,
Runtime: &runtime.DefaultRuntime,
Store: &store.DefaultStore,
Tracer: &trace.DefaultTracer,
Profile: &profile.DefaultProfile,
Expand Down Expand Up @@ -371,16 +356,6 @@ func (c *cmd) Before(ctx *cli.Context) error {
*c.opts.Store = s(store.WithClient(*c.opts.Client))
}

// Set the runtime
if name := ctx.String("runtime"); len(name) > 0 {
r, ok := c.opts.Runtimes[name]
if !ok {
return fmt.Errorf("Unsupported runtime: %s", name)
}

*c.opts.Runtime = r(runtime.WithClient(*c.opts.Client))
}

// Set the tracer
if name := ctx.String("tracer"); len(name) > 0 {
r, ok := c.opts.Tracers[name]
Expand Down Expand Up @@ -566,12 +541,6 @@ func (c *cmd) Before(ctx *cli.Context) error {
serverOpts = append(serverOpts, server.RegisterInterval(val*time.Second))
}

if len(ctx.String("runtime_source")) > 0 {
if err := (*c.opts.Runtime).Init(runtime.WithSource(ctx.String("runtime_source"))); err != nil {
logger.Fatalf("Error configuring runtime: %v", err)
}
}

// client opts
if r := ctx.Int("client_retries"); r >= 0 {
clientOpts = append(clientOpts, client.Retries(r))
Expand Down
1 change: 0 additions & 1 deletion util/cmd/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"go-micro.dev/v5/debug/profile"
"go-micro.dev/v5/debug/trace"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/runtime"
"go-micro.dev/v5/selector"
"go-micro.dev/v5/server"
"go-micro.dev/v5/store"
Expand Down

0 comments on commit 3676232

Please sign in to comment.