mirror of
https://github.com/go-micro/go-micro.git
synced 2025-05-31 21:59:42 +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
|
||||
// traps TERM, INT, and QUIT. Users of this feature to disable the signal
|
||||
// handler, should control liveness of the service through the context.
|
||||
|
Loading…
x
Reference in New Issue
Block a user