v3 refactor (#1868)
* Move to v3 Co-authored-by: Ben Toogood <bentoogood@gmail.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"github.com/micro/go-micro/v2/client"
|
||||
gclient "github.com/micro/go-micro/v2/client/grpc"
|
||||
"github.com/micro/go-micro/v2/model"
|
||||
"github.com/micro/go-micro/v2/server"
|
||||
gserver "github.com/micro/go-micro/v2/server/grpc"
|
||||
"github.com/micro/go-micro/v2/service"
|
||||
"github.com/micro/go-micro/v3/client"
|
||||
gclient "github.com/micro/go-micro/v3/client/grpc"
|
||||
"github.com/micro/go-micro/v3/model"
|
||||
"github.com/micro/go-micro/v3/server"
|
||||
gserver "github.com/micro/go-micro/v3/server/grpc"
|
||||
"github.com/micro/go-micro/v3/service"
|
||||
)
|
||||
|
||||
type grpcService struct {
|
||||
|
@@ -7,10 +7,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/micro/go-micro/v2/registry/memory"
|
||||
"github.com/micro/go-micro/v2/service"
|
||||
hello "github.com/micro/go-micro/v2/service/grpc/proto"
|
||||
mls "github.com/micro/go-micro/v2/util/tls"
|
||||
"github.com/micro/go-micro/v3/registry/memory"
|
||||
"github.com/micro/go-micro/v3/service"
|
||||
hello "github.com/micro/go-micro/v3/service/grpc/proto"
|
||||
mls "github.com/micro/go-micro/v3/util/tls"
|
||||
)
|
||||
|
||||
type testHandler struct{}
|
||||
|
@@ -3,9 +3,9 @@ package grpc
|
||||
import (
|
||||
"crypto/tls"
|
||||
|
||||
gc "github.com/micro/go-micro/v2/client/grpc"
|
||||
gs "github.com/micro/go-micro/v2/server/grpc"
|
||||
"github.com/micro/go-micro/v2/service"
|
||||
gc "github.com/micro/go-micro/v3/client/grpc"
|
||||
gs "github.com/micro/go-micro/v3/server/grpc"
|
||||
"github.com/micro/go-micro/v3/service"
|
||||
)
|
||||
|
||||
// WithTLS sets the TLS config for the service
|
||||
|
@@ -11,9 +11,9 @@ import (
|
||||
|
||||
import (
|
||||
context "context"
|
||||
api "github.com/micro/go-micro/v2/api"
|
||||
client "github.com/micro/go-micro/v2/client"
|
||||
server "github.com/micro/go-micro/v2/server"
|
||||
api "github.com/micro/go-micro/v3/api"
|
||||
client "github.com/micro/go-micro/v3/client"
|
||||
server "github.com/micro/go-micro/v3/server"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
@@ -2,12 +2,12 @@
|
||||
package mucp
|
||||
|
||||
import (
|
||||
"github.com/micro/go-micro/v2/client"
|
||||
cmucp "github.com/micro/go-micro/v2/client/mucp"
|
||||
"github.com/micro/go-micro/v2/model"
|
||||
"github.com/micro/go-micro/v2/server"
|
||||
smucp "github.com/micro/go-micro/v2/server/mucp"
|
||||
"github.com/micro/go-micro/v2/service"
|
||||
"github.com/micro/go-micro/v3/client"
|
||||
cmucp "github.com/micro/go-micro/v3/client/mucp"
|
||||
"github.com/micro/go-micro/v3/model"
|
||||
"github.com/micro/go-micro/v3/server"
|
||||
smucp "github.com/micro/go-micro/v3/server/mucp"
|
||||
"github.com/micro/go-micro/v3/service"
|
||||
)
|
||||
|
||||
type mucpService struct {
|
||||
|
@@ -4,12 +4,17 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/micro/go-micro/v2/broker"
|
||||
"github.com/micro/go-micro/v2/client"
|
||||
"github.com/micro/go-micro/v2/model"
|
||||
"github.com/micro/go-micro/v2/registry"
|
||||
"github.com/micro/go-micro/v2/server"
|
||||
"github.com/micro/go-micro/v2/transport"
|
||||
"github.com/micro/go-micro/v3/broker"
|
||||
"github.com/micro/go-micro/v3/broker/http"
|
||||
"github.com/micro/go-micro/v3/client"
|
||||
mucpClient "github.com/micro/go-micro/v3/client/mucp"
|
||||
"github.com/micro/go-micro/v3/model"
|
||||
"github.com/micro/go-micro/v3/registry"
|
||||
"github.com/micro/go-micro/v3/registry/mdns"
|
||||
"github.com/micro/go-micro/v3/server"
|
||||
mucpServer "github.com/micro/go-micro/v3/server/mucp"
|
||||
"github.com/micro/go-micro/v3/transport"
|
||||
thttp "github.com/micro/go-micro/v3/transport/http"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
@@ -35,11 +40,11 @@ type Option func(*Options)
|
||||
|
||||
func NewOptions(opts ...Option) Options {
|
||||
opt := Options{
|
||||
Broker: broker.DefaultBroker,
|
||||
Client: client.DefaultClient,
|
||||
Server: server.DefaultServer,
|
||||
Registry: registry.DefaultRegistry,
|
||||
Transport: transport.DefaultTransport,
|
||||
Broker: http.NewBroker(),
|
||||
Client: mucpClient.NewClient(),
|
||||
Server: mucpServer.NewServer(),
|
||||
Registry: mdns.NewRegistry(),
|
||||
Transport: thttp.NewTransport(),
|
||||
Context: context.Background(),
|
||||
}
|
||||
|
||||
|
@@ -2,9 +2,9 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/micro/go-micro/v2/client"
|
||||
"github.com/micro/go-micro/v2/model"
|
||||
"github.com/micro/go-micro/v2/server"
|
||||
"github.com/micro/go-micro/v3/client"
|
||||
"github.com/micro/go-micro/v3/model"
|
||||
"github.com/micro/go-micro/v3/server"
|
||||
)
|
||||
|
||||
// Service is an interface for a micro service
|
||||
|
Reference in New Issue
Block a user