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

18 lines
480 B
Go

package redigo // import "gopkg.in/DataDog/dd-trace-go.v1/contrib/garyburd/redigo"
type dialConfig struct{ serviceName string }
// DialOption represents an option that can be passed to Dial.
type DialOption func(*dialConfig)
func defaults(cfg *dialConfig) {
cfg.serviceName = "redis.conn"
}
// WithServiceName sets the given service name for the dialled connection.
func WithServiceName(name string) DialOption {
return func(cfg *dialConfig) {
cfg.serviceName = name
}
}