mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
Add Handle option (#2627)
This commit is contained in:
parent
d392e72021
commit
d44ed328d1
@ -112,6 +112,15 @@ func Context(ctx context.Context) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle will register a handler without any fuss
|
||||||
|
func Handle(v interface{}) Option {
|
||||||
|
return func(o *Options) {
|
||||||
|
o.Server.Handle(
|
||||||
|
o.Server.NewHandler(v),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HandleSignal toggles automatic installation of the signal handler that
|
// HandleSignal toggles automatic installation of the signal handler that
|
||||||
// traps TERM, INT, and QUIT. Users of this feature to disable the signal
|
// traps TERM, INT, and QUIT. Users of this feature to disable the signal
|
||||||
// handler, should control liveness of the service through the context.
|
// handler, should control liveness of the service through the context.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user