v3 refactor (#1868)
* Move to v3 Co-authored-by: Ben Toogood <bentoogood@gmail.com>
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/micro/go-micro/v2/api/resolver"
|
||||
"github.com/micro/go-micro/v2/api/resolver/vpath"
|
||||
"github.com/micro/go-micro/v2/registry"
|
||||
"github.com/micro/go-micro/v3/api/resolver"
|
||||
"github.com/micro/go-micro/v3/api/resolver/vpath"
|
||||
"github.com/micro/go-micro/v3/registry"
|
||||
"github.com/micro/go-micro/v3/registry/mdns"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
@@ -17,7 +18,7 @@ type Option func(o *Options)
|
||||
func NewOptions(opts ...Option) Options {
|
||||
options := Options{
|
||||
Handler: "meta",
|
||||
Registry: registry.DefaultRegistry,
|
||||
Registry: mdns.NewRegistry(),
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
|
||||
@@ -10,13 +10,13 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/micro/go-micro/v2/api"
|
||||
"github.com/micro/go-micro/v2/api/router"
|
||||
"github.com/micro/go-micro/v2/api/router/util"
|
||||
"github.com/micro/go-micro/v2/logger"
|
||||
"github.com/micro/go-micro/v2/metadata"
|
||||
"github.com/micro/go-micro/v2/registry"
|
||||
"github.com/micro/go-micro/v2/registry/cache"
|
||||
"github.com/micro/go-micro/v3/api"
|
||||
"github.com/micro/go-micro/v3/api/router"
|
||||
"github.com/micro/go-micro/v3/api/router/util"
|
||||
"github.com/micro/go-micro/v3/logger"
|
||||
"github.com/micro/go-micro/v3/metadata"
|
||||
"github.com/micro/go-micro/v3/registry"
|
||||
"github.com/micro/go-micro/v3/registry/cache"
|
||||
)
|
||||
|
||||
// endpoint struct, that holds compiled pcre
|
||||
|
||||
@@ -3,7 +3,7 @@ package registry
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/micro/go-micro/v2/registry"
|
||||
"github.com/micro/go-micro/v3/registry"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ package router
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/micro/go-micro/v2/api"
|
||||
"github.com/micro/go-micro/v3/api"
|
||||
)
|
||||
|
||||
// Router is used to determine an endpoint for a request
|
||||
|
||||
@@ -9,18 +9,18 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/micro/go-micro/v2/api"
|
||||
"github.com/micro/go-micro/v2/api/handler"
|
||||
"github.com/micro/go-micro/v2/api/handler/rpc"
|
||||
"github.com/micro/go-micro/v2/api/router"
|
||||
rregistry "github.com/micro/go-micro/v2/api/router/registry"
|
||||
rstatic "github.com/micro/go-micro/v2/api/router/static"
|
||||
"github.com/micro/go-micro/v2/client"
|
||||
gcli "github.com/micro/go-micro/v2/client/grpc"
|
||||
rmemory "github.com/micro/go-micro/v2/registry/memory"
|
||||
"github.com/micro/go-micro/v2/server"
|
||||
gsrv "github.com/micro/go-micro/v2/server/grpc"
|
||||
pb "github.com/micro/go-micro/v2/server/grpc/proto"
|
||||
"github.com/micro/go-micro/v3/api"
|
||||
"github.com/micro/go-micro/v3/api/handler"
|
||||
"github.com/micro/go-micro/v3/api/handler/rpc"
|
||||
"github.com/micro/go-micro/v3/api/router"
|
||||
rregistry "github.com/micro/go-micro/v3/api/router/registry"
|
||||
rstatic "github.com/micro/go-micro/v3/api/router/static"
|
||||
"github.com/micro/go-micro/v3/client"
|
||||
gcli "github.com/micro/go-micro/v3/client/grpc"
|
||||
rmemory "github.com/micro/go-micro/v3/registry/memory"
|
||||
"github.com/micro/go-micro/v3/server"
|
||||
gsrv "github.com/micro/go-micro/v3/server/grpc"
|
||||
pb "github.com/micro/go-micro/v3/server/grpc/proto"
|
||||
)
|
||||
|
||||
// server is used to implement helloworld.GreeterServer.
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/micro/go-micro/v2/api"
|
||||
"github.com/micro/go-micro/v2/api/router"
|
||||
"github.com/micro/go-micro/v2/api/router/util"
|
||||
"github.com/micro/go-micro/v2/logger"
|
||||
"github.com/micro/go-micro/v2/metadata"
|
||||
"github.com/micro/go-micro/v2/registry"
|
||||
rutil "github.com/micro/go-micro/v2/util/registry"
|
||||
"github.com/micro/go-micro/v3/api"
|
||||
"github.com/micro/go-micro/v3/api/router"
|
||||
"github.com/micro/go-micro/v3/api/router/util"
|
||||
"github.com/micro/go-micro/v3/logger"
|
||||
"github.com/micro/go-micro/v3/metadata"
|
||||
"github.com/micro/go-micro/v3/registry"
|
||||
rutil "github.com/micro/go-micro/v3/util/registry"
|
||||
)
|
||||
|
||||
type endpoint struct {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/micro/go-micro/v2/logger"
|
||||
"github.com/micro/go-micro/v3/logger"
|
||||
)
|
||||
|
||||
// InvalidTemplateError indicates that the path template is not valid.
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/micro/go-micro/v2/logger"
|
||||
"github.com/micro/go-micro/v3/logger"
|
||||
)
|
||||
|
||||
func TestTokenize(t *testing.T) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/micro/go-micro/v2/logger"
|
||||
"github.com/micro/go-micro/v3/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user