blob: 0f4016c5e0a8dca275859e9aa5e49f4cc93f76a2 [file]
package rediswatcher
import (
"github.com/google/uuid"
rds "github.com/redis/go-redis/v9"
)
type WatcherOptions struct {
Options rds.Options
ClusterOptions rds.ClusterOptions
SubClient rds.UniversalClient
PubClient rds.UniversalClient
Channel string
IgnoreSelf bool
LocalID string
OptionalUpdateCallback func(string)
}
func initConfig(option *WatcherOptions) {
if option.LocalID == "" {
option.LocalID = uuid.New().String()
}
if option.Channel == "" {
option.Channel = "/casbin"
}
}