Remove use of config/cmd in api

This commit is contained in:
Asim Aslam 2019-12-30 17:29:20 +00:00
parent c145f355dd
commit e0078bbcd5
2 changed files with 1 additions and 4 deletions

View File

@ -9,14 +9,12 @@ import (
"github.com/micro/go-micro/api/handler" "github.com/micro/go-micro/api/handler"
"github.com/micro/go-micro/api/router" "github.com/micro/go-micro/api/router"
regRouter "github.com/micro/go-micro/api/router/registry" regRouter "github.com/micro/go-micro/api/router/registry"
"github.com/micro/go-micro/config/cmd"
"github.com/micro/go-micro/registry" "github.com/micro/go-micro/registry"
"github.com/micro/go-micro/registry/memory" "github.com/micro/go-micro/registry/memory"
) )
func testHttp(t *testing.T, path, service, ns string) { func testHttp(t *testing.T, path, service, ns string) {
r := memory.NewRegistry() r := memory.NewRegistry()
cmd.DefaultCmd = cmd.NewCmd(cmd.Registry(&r))
l, err := net.Listen("tcp", "127.0.0.1:0") l, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil { if err != nil {

View File

@ -3,7 +3,6 @@ package router
import ( import (
"github.com/micro/go-micro/api/resolver" "github.com/micro/go-micro/api/resolver"
"github.com/micro/go-micro/api/resolver/micro" "github.com/micro/go-micro/api/resolver/micro"
"github.com/micro/go-micro/config/cmd"
"github.com/micro/go-micro/registry" "github.com/micro/go-micro/registry"
) )
@ -19,7 +18,7 @@ type Option func(o *Options)
func NewOptions(opts ...Option) Options { func NewOptions(opts ...Option) Options {
options := Options{ options := Options{
Handler: "meta", Handler: "meta",
Registry: *cmd.DefaultOptions().Registry, Registry: registry.DefaultRegistry,
} }
for _, o := range opts { for _, o := range opts {