diff --git a/url.go b/url.go index 0116172..9ba6113 100644 --- a/url.go +++ b/url.go @@ -41,11 +41,11 @@ func ParseURL(str string) (opt ClientOption, err error) { return dialer.Dial("unix", s) } opt.InitAddress = []string{strings.TrimSpace(u.Path)} - case "rediss": + case "rediss", "valkeys": opt.TLSConfig = &tls.Config{ MinVersion: tls.VersionTLS12, } - case "redis": + case "redis", "valkey": default: return opt, fmt.Errorf("valkey: invalid URL scheme: %s", u.Scheme) } diff --git a/url_test.go b/url_test.go index db08074..ffb218c 100644 --- a/url_test.go +++ b/url_test.go @@ -15,9 +15,15 @@ func TestParseURL(t *testing.T) { if opt, err := ParseURL("rediss://"); err != nil || opt.TLSConfig == nil { t.Fatalf("unexpected %v %v", opt, err) } + if opt, err := ParseURL("valkeys://"); err != nil || opt.TLSConfig == nil { + t.Fatalf("unexpected %v %v", opt, err) + } if opt, err := ParseURL("unix://"); err != nil || opt.DialFn == nil { t.Fatalf("unexpected %v %v", opt, err) } + if opt, err := ParseURL("valkey://"); err != nil { + t.Fatalf("unexpected %v %v", opt, err) + } if opt, err := ParseURL("redis://"); err != nil || opt.InitAddress[0] != "localhost:6379" { t.Fatalf("unexpected %v %v", opt, err) }