close micro-roadmap/issues/12
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
14
options.go
14
options.go
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/unistack-org/micro/v3/config"
|
||||
"github.com/unistack-org/micro/v3/debug/profile"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"github.com/unistack-org/micro/v3/registry"
|
||||
"github.com/unistack-org/micro/v3/router"
|
||||
"github.com/unistack-org/micro/v3/runtime"
|
||||
@@ -19,7 +20,6 @@ import (
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
"github.com/unistack-org/micro/v3/store"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
// Options for micro service
|
||||
@@ -47,14 +47,11 @@ type Options struct {
|
||||
// Other options for implementations of the interface
|
||||
// can be stored in a context
|
||||
Context context.Context
|
||||
|
||||
Signal bool
|
||||
}
|
||||
|
||||
func newOptions(opts ...Option) Options {
|
||||
opt := Options{
|
||||
Context: context.Background(),
|
||||
Signal: true,
|
||||
Server: server.DefaultServer,
|
||||
Client: client.DefaultClient,
|
||||
Broker: broker.DefaultBroker,
|
||||
@@ -113,15 +110,6 @@ func Context(ctx context.Context) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// HandleSignal toggles automatic installation of the signal handler that
|
||||
// traps TERM, INT, and QUIT. Users of this feature to disable the signal
|
||||
// handler, should control liveness of the service through the context.
|
||||
func HandleSignal(b bool) Option {
|
||||
return func(o *Options) {
|
||||
o.Signal = b
|
||||
}
|
||||
}
|
||||
|
||||
// Profile to be used for debug profile
|
||||
func Profile(p profile.Profile) Option {
|
||||
return func(o *Options) {
|
||||
|
||||
Reference in New Issue
Block a user