Files
bridge/internal/routes/options.go
2023-07-01 00:04:52 +00:00

28 lines
521 B
Go

package routes
import (
"go.equinixmetal.net/infra9-metal-bridge/internal/service"
"go.uber.org/zap"
)
// Option is a functional configuration option for the router.
type Option func(r *Router) error
// WithLogger sets the logger for the router.
func WithLogger(logger *zap.Logger) Option {
return func(r *Router) error {
r.logger = logger
return nil
}
}
// WithService sets the service handler.
func WithService(svc service.Service) Option {
return func(r *Router) error {
r.svc = svc
return nil
}
}