class

JoobQ::RedisEndpoint

Inherits Reference < Object

Where and how to reach a Redis server, read from a URL:

redis://[user:password@]host[:port][/database] plain connection rediss://[user:password@]host[:port][/database] TLS unix:///path/to/redis.sock[?db=N] unix socket

A user name selects an ACL user (Redis 6+); a password alone is the default user's. Percent-encode @ / : ? # % in the user name or password; a literal + stays a +. A query or fragment is refused (a credential put there would be ignored without a word), except db on a unix URL.

The password never appears in to_s, inspect or an error message, and neither does the URL.

Constants

DEFAULT_PORT = 6379

Constructors

new(host : String, port : Int32 = DEFAULT_PORT, user : String | Nil = nil, password : String | Nil = nil, database : Int32 | Nil = nil, tls : Bool = false, verify : Bool = true, ca_file : String | Nil = nil, unixsocket : String | Nil = nil)
Source
parse(url : String, verify : Bool = true, ca_file : String | Nil = nil) : RedisEndpoint
Source

Instance methods

ca_file

PEM file with certificate authorities to trust in addition to the system's.

Source
database
Source
host
Source
inspect(io : IO) : Nil

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Source
password
Source
port
Source
ssl_context

The context for the TLS connection, or nil for a plain one. The server's certificate chain is checked against the system's authorities and ca_file, and its host name against this endpoint's host (a certificate any trusted authority issued for another host is refused), unless verify is off. SSLv3 and TLS 1.0 and 1.1 are refused. The redis shard sends no server name (SNI), so a server that picks its certificate by name needs a default one.

Source
tls?
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
unixsocket
Source
user
Source
verify?

Whether the server's certificate chain and host name are checked (they are, unless this is turned off).

Source

Nested types