I’m trying to use Go to connect to my RediSearch (Redis module) instance.
Combing through the documentation and Go code that generates the client, I don’t see how to pass authentication options to the Redigo client within… Is this an oversight on my part or are we just expected to use RediSearch without securing the database?
I’ve also tried the following when generating a RediSearch client. Each gives errors regarding the format of the URL:
redisearch.NewClient("[email protected]:6379", index)
redisearch.NewClient("redis://[email protected]:6379", index)
Within pool.go
, in the NewSingleHostPool
function that returns a client, it seems like it should pass DialOptions
into the Dial
Redigo function instead of nil
, and have those options be passed into the RediSearch NewClient
function…
2
Answers
Call NewClientWithPool with a pool dial function of your choice.
A nice way to do this is like so, with built-in constructs for password auth by redigo:
Your
server
should look like this:redis-1344.333.us-east-1-mz.ec2.com:17885
and the password is plain text.