Skip to content

cache

A storage-agnostic, JSON-based cache backed by any go/io Medium — local disk, in-memory, or a sandboxed root — so the same cache code runs against real storage in production and an ephemeral mock in tests.

Terminal window
go get dappco.re/go/cache@latest
import "dappco.re/go/cache"

Build a cache over any io.Medium:

r := cache.NewCacheStorage(medium, "cache")
if !r.OK { return r }

Or register it as a core/go service on a *core.Core:

if r := cache.NewService(cfg)(c); !r.OK { return r }
  • go/io — the Medium contract the cache is backed by
  • go/store — KV + workspace persistence

github.com/dappcore/go-cache — full source, issues, and releases.