module(..., package.seeall)
require "sidereal"
local m_redis

function Init (options)
	assert(type(options) == "table", "options must be a table")
	assert(options.redis, "options.redis is missing")
	assert(options.redis.host, "missing options.redis.host field")
	assert(options.redis.port, "missing options.redis.port field")
	LogDebug("[HELPERS.redis.Init] REDIS connecting to:  " .. tostring(options.redis.host) .. ":" .. tostring(options.redis.port))
	m_redis = sidereal.connect(options.redis.host, tonumber(options.redis.port))
	return m_redis
end

function GetClient ()
	assert(m_redis)
	return m_redis
end
