remove transport options

This commit is contained in:
Asim Aslam
2020-09-26 13:29:09 +01:00
parent d8f17ac827
commit 017e156440

View File

@@ -9,8 +9,6 @@ import (
"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/network/transport"
thttp "github.com/micro/go-micro/v3/network/transport/http"
"github.com/micro/go-micro/v3/registry"
"github.com/micro/go-micro/v3/registry/mdns"
"github.com/micro/go-micro/v3/server"
@@ -23,7 +21,6 @@ type Options struct {
Server server.Server
Model model.Model
Registry registry.Registry
Transport transport.Transport
// Before and After funcs
BeforeStart []func() error
@@ -44,7 +41,6 @@ func NewOptions(opts ...Option) Options {
Client: mucpClient.NewClient(),
Server: mucpServer.NewServer(),
Registry: mdns.NewRegistry(),
Transport: thttp.NewTransport(),
Context: context.Background(),
}
@@ -107,17 +103,6 @@ func Registry(r registry.Registry) Option {
}
}
// Transport sets the transport for the service
// and the underlying components
func Transport(t transport.Transport) Option {
return func(o *Options) {
o.Transport = t
// Update Client and Server
o.Client.Init(client.Transport(t))
o.Server.Init(server.Transport(t))
}
}
// Convenience options
// Address sets the address of the server