ipld-eth-server/vendor/gopkg.in/DataDog/dd-trace-go.v1/contrib/julienschmidt/httprouter/option.go
2018-09-11 16:30:29 -05:00

18 lines
427 B
Go

package httprouter
type routerConfig struct{ serviceName string }
// RouterOption represents an option that can be passed to New.
type RouterOption func(*routerConfig)
func defaults(cfg *routerConfig) {
cfg.serviceName = "http.router"
}
// WithServiceName sets the given service name for the returned router.
func WithServiceName(name string) RouterOption {
return func(cfg *routerConfig) {
cfg.serviceName = name
}
}