Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support redis+socket scheme in url #669

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

corpix
Copy link

@corpix corpix commented Apr 24, 2024

I've seen similar topic was mentioned in:

I see this package used by https://github.com/gocelery/gocelery which is used by one of the services I maintain. I think it is good to be able to pass Redis URL pointing to UNIX socket (from config file) even if IANA specification draft doesn't mention this particular URI scheme.

What do you think about this changeset?

@@ -680,6 +680,8 @@ var dialURLTests = []struct {
{"database 3", "redis://localhost/3", "+OK\r\n", "*2\r\n$6\r\nSELECT\r\n$1\r\n3\r\n"},
{"database 99", "redis://localhost/99", "+OK\r\n", "*2\r\n$6\r\nSELECT\r\n$2\r\n99\r\n"},
{"no database", "redis://localhost/", "+OK\r\n", ""},
{"database 99", "redis+socket://./server.sock?db=99", "+OK\r\n", "*2\r\n$6\r\nSELECT\r\n$2\r\n99\r\n"},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need to differentiate with a different prefix here or could we simplify by requiring all sock paths to be relative or absolute?

Relative must start with . and absolute must start with /?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants