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