class CQL::Cache::CacheStoreConfig

Overview

Configuration for cache store

Defined in:

cache/cache_store.cr

Constructors

Instance Method Summary

Constructor Detail

def self.from_env : CacheStoreConfig #

Configure from environment variables


[View source]
def self.from_hash(hash : Hash(String, String | Int32 | Int64 | Bool)) : CacheStoreConfig #

Create from Hash (useful for configuration files)


[View source]
def self.new(type : CQL::Cache::CacheStoreType = CacheStoreType::Memory, default_ttl : Time::Span = 1.hour, key_prefix : String = "cql", max_size : Int32 | Nil = nil, memory_max_size : Int32 | Nil = nil, redis_url : String = "redis://localhost:6379/0", redis_pool_size : Int32 = 25, redis_timeout : Time::Span = 5.seconds) #

[View source]

Instance Method Detail

def default_ttl : Time::Span #

[View source]
def default_ttl=(default_ttl : Time::Span) #

[View source]
def key_prefix : String #

[View source]
def key_prefix=(key_prefix : String) #

[View source]
def max_size : Int32 | Nil #

[View source]
def max_size=(max_size : Int32 | Nil) #

[View source]
def memory_max_size : Int32 | Nil #

Memory cache specific options


[View source]
def memory_max_size=(memory_max_size : Int32 | Nil) #

Memory cache specific options


[View source]
def redis_pool_size : Int32 #

[View source]
def redis_pool_size=(redis_pool_size : Int32) #

[View source]
def redis_timeout : Time::Span #

[View source]
def redis_timeout=(redis_timeout : Time::Span) #

[View source]
def redis_url : String #

Redis cache specific options


[View source]
def redis_url=(redis_url : String) #

Redis cache specific options


[View source]
def type : CacheStoreType #

[View source]
def type=(type : CacheStoreType) #

[View source]