18 lines
427 B
Go
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
|
||
|
}
|
||
|
}
|