class Zap::Utils::Fetch::Cache::InStore(T)

Defined in:

utils/fetch/cache.cr

Constant Summary

BODY_FILE_NAME = "body"
BODY_FILE_NAME_TEMP = "body.temp"
META_FILE_NAME = "meta"
META_FILE_NAME_TEMP = "meta.temp"

Constructors

Instance Method Summary

Instance methods inherited from class Zap::Utils::Fetch::Cache(T)

get(key_str : String, etag : String | Nil) : T | Nil
get(key_str : String, &etag : -> String | Nil) : T | Nil
get
, set(key_str : String, value : T, expiry : Time::Span | Nil, etag : String | Nil) : Nil set

Class methods inherited from class Zap::Utils::Fetch::Cache(T)

hash(str) hash

Instance methods inherited from class Object

or(other : T) : T | self forall T or, pipe(&) pipe

Constructor Detail

def self.new(store_path, *, serializer : Serializer(T), bypass_staleness_checks : Bool = false, raise_on_cache_miss : Bool = false) #

[View source]

Instance Method Detail

def get(key_str : String, etag : String | Nil = nil) : T | Nil #

[View source]
def get(key_str : String, &get_etag : -> String | Nil) : T | Nil #

[View source]
def set(key_str : String, value : T, expiry : Time::Span | Nil = nil, etag : String | Nil = nil) : Nil #

[View source]