2021-01-16 03:00:25 +03:00
|
|
|
package redis
|
|
|
|
|
|
|
|
import (
|
2023-10-20 23:51:29 +03:00
|
|
|
"github.com/redis/go-redis/v9"
|
2023-10-21 00:57:12 +03:00
|
|
|
"go.unistack.org/micro/v4/options"
|
2021-01-16 03:00:25 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type configKey struct{}
|
|
|
|
|
2023-10-21 00:57:12 +03:00
|
|
|
func Config(c *redis.Options) options.Option {
|
|
|
|
return options.ContextOption(configKey{}, c)
|
2021-01-16 03:00:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type clusterConfigKey struct{}
|
|
|
|
|
2023-10-21 00:57:12 +03:00
|
|
|
func ClusterConfig(c *redis.ClusterOptions) options.Option {
|
|
|
|
return options.ContextOption(clusterConfigKey{}, c)
|
2021-01-16 03:00:25 +03:00
|
|
|
}
|