Skip to content

Commit

Permalink
Add Handle option (#2627)
Browse files Browse the repository at this point in the history
  • Loading branch information
asim authored Apr 11, 2023
1 parent d392e72 commit d44ed32
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d44ed32

Please sign in to comment.