Experimental server side wrappers for handlers
This commit is contained in:
@@ -18,6 +18,7 @@ type options struct {
|
||||
advertise string
|
||||
id string
|
||||
version string
|
||||
wrappers []Wrapper
|
||||
}
|
||||
|
||||
func newOptions(opt ...Option) options {
|
||||
@@ -153,3 +154,10 @@ func Metadata(md map[string]string) Option {
|
||||
o.metadata = md
|
||||
}
|
||||
}
|
||||
|
||||
// Adds a handler Wrapper to a list of options passed into the server
|
||||
func Wrap(w Wrapper) Option {
|
||||
return func(o *options) {
|
||||
o.wrappers = append(o.wrappers, w)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user