Lotus cache facade. If no adapter configured, acts as a no-op pass-through.
Summary
Functions
Builds the per-entry options for a cache write.
Invalidates all cache entries associated with the given scope.
Types
@type key() :: binary()
@type opts() :: Keyword.t()
@type ttl_ms() :: non_neg_integer()
@type value() :: any()
Functions
Builds the per-entry options for a cache write.
Layers the caller's :cache option over the entry options set in
application config, then adds the invalidation tags. A caller that passes
no :cache option, or an atom such as :bypass, still gets the
configured defaults.
@spec enabled?() :: boolean()
Invalidates all cache entries associated with the given scope.
Uses tag-based invalidation — each scoped cache entry is tagged with
"scope:<digest>", so this clears only entries for the specified scope
without flushing the entire source cache.
Examples
Lotus.Cache.invalidate_scope(%{tenant_id: 42})
Lotus.Cache.invalidate_scope(%{role: :admin})