Add Router interface
This commit is contained in:
@@ -25,8 +25,12 @@ type Options struct {
|
||||
HdlrWrappers []HandlerWrapper
|
||||
SubWrappers []SubscriberWrapper
|
||||
|
||||
// The register expiry time
|
||||
RegisterTTL time.Duration
|
||||
|
||||
// The router for requests
|
||||
Router Router
|
||||
|
||||
// Debug Handler which can be set by a user
|
||||
DebugHandler debug.DebugHandler
|
||||
|
||||
@@ -164,6 +168,13 @@ func RegisterTTL(t time.Duration) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithRouter sets the request router
|
||||
func WithRouter(r Router) Option {
|
||||
return func(o *Options) {
|
||||
o.Router = r
|
||||
}
|
||||
}
|
||||
|
||||
// Wait tells the server to wait for requests to finish before exiting
|
||||
func Wait(b bool) Option {
|
||||
return func(o *Options) {
|
||||
|
Reference in New Issue
Block a user