mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
Disable Clients
This commit is contained in:
parent
09d1450d7d
commit
ca791d7e8d
18
service.go
18
service.go
@ -16,8 +16,6 @@ import (
|
|||||||
"github.com/micro/go-micro/v2/debug/trace"
|
"github.com/micro/go-micro/v2/debug/trace"
|
||||||
"github.com/micro/go-micro/v2/logger"
|
"github.com/micro/go-micro/v2/logger"
|
||||||
"github.com/micro/go-micro/v2/plugin"
|
"github.com/micro/go-micro/v2/plugin"
|
||||||
registrySrv "github.com/micro/go-micro/v2/registry/service"
|
|
||||||
"github.com/micro/go-micro/v2/runtime"
|
|
||||||
"github.com/micro/go-micro/v2/server"
|
"github.com/micro/go-micro/v2/server"
|
||||||
"github.com/micro/go-micro/v2/store"
|
"github.com/micro/go-micro/v2/store"
|
||||||
signalutil "github.com/micro/go-micro/v2/util/signal"
|
signalutil "github.com/micro/go-micro/v2/util/signal"
|
||||||
@ -54,10 +52,10 @@ func newService(opts ...Option) Service {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// set the client in the service implementations
|
// set the client in the service implementations
|
||||||
options.Auth.Init(auth.WithClient(options.Client))
|
// options.Auth.Init(auth.WithClient(options.Client))
|
||||||
options.Registry.Init(registrySrv.WithClient(options.Client))
|
// options.Registry.Init(registrySrv.WithClient(options.Client))
|
||||||
options.Runtime.Init(runtime.WithClient(options.Client))
|
// options.Runtime.Init(runtime.WithClient(options.Client))
|
||||||
options.Store.Init(store.WithClient(options.Client))
|
// options.Store.Init(store.WithClient(options.Client))
|
||||||
|
|
||||||
// set opts
|
// set opts
|
||||||
service.opts = options
|
service.opts = options
|
||||||
@ -126,10 +124,10 @@ func (s *service) Init(opts ...Option) {
|
|||||||
// previously in newService for micro (since init is never called)
|
// previously in newService for micro (since init is never called)
|
||||||
// however it needs to be done again here since for normal go-micro
|
// however it needs to be done again here since for normal go-micro
|
||||||
// services the implementation may have changed by CLI flags.
|
// services the implementation may have changed by CLI flags.
|
||||||
s.opts.Auth.Init(auth.WithClient(s.Client()))
|
// s.opts.Auth.Init(auth.WithClient(s.Client()))
|
||||||
s.opts.Registry.Init(registrySrv.WithClient(s.Client()))
|
// s.opts.Registry.Init(registrySrv.WithClient(s.Client()))
|
||||||
s.opts.Runtime.Init(runtime.WithClient(s.Client()))
|
// s.opts.Runtime.Init(runtime.WithClient(s.Client()))
|
||||||
s.opts.Store.Init(store.WithClient(s.Client()))
|
// s.opts.Store.Init(store.WithClient(s.Client()))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user