mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-03 11:38:23 -05:00
* bump dependencies Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * bump reva and add config options Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> --------- Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
34 lines
609 B
Go
34 lines
609 B
Go
package resolver
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// NewOptions wires options together.
|
|
func NewOptions(opts ...Option) Options {
|
|
var options Options
|
|
for _, o := range opts {
|
|
o(&options)
|
|
}
|
|
|
|
if options.Namespace == nil {
|
|
options.Namespace = StaticNamespace("go.micro")
|
|
}
|
|
|
|
return options
|
|
}
|
|
|
|
// WithHandler sets the handler being used.
|
|
func WithHandler(h string) Option {
|
|
return func(o *Options) {
|
|
o.Handler = h
|
|
}
|
|
}
|
|
|
|
// WithNamespace sets the function which determines the namespace for a request.
|
|
func WithNamespace(n func(*http.Request) string) Option {
|
|
return func(o *Options) {
|
|
o.Namespace = n
|
|
}
|
|
}
|