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

18 lines
499 B
Go

package redis // import "gopkg.in/DataDog/dd-trace-go.v1/contrib/go-redis/redis"
type clientConfig struct{ serviceName string }
// ClientOption represents an option that can be used to create or wrap a client.
type ClientOption func(*clientConfig)
func defaults(cfg *clientConfig) {
cfg.serviceName = "redis.client"
}
// WithServiceName sets the given service name for the client.
func WithServiceName(name string) ClientOption {
return func(cfg *clientConfig) {
cfg.serviceName = name
}
}