Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Memory ¶
Memory is a simple in-memory storage for data indexed by ld.Link. (It's little more than a map -- in fact, the map is exported, and you can poke it directly.)
The OpenRead method conforms to ld.BlockReadOpener, and the OpenWrite method conforms to ld.BlockWriteOpener. Therefore it's easy to use in a LinkSystem like this:
store := storage.Memory{} lsys.StorageReadOpener = (&store).OpenRead lsys.StorageWriteOpener = (&store).OpenWrite
This storage is mostly expected to be used for testing and demos, and as an example of how you can implement and integrate your own storage systems.
func (*Memory) OpenWrite ¶
func (store *Memory) OpenWrite(lnkCtx ld.LinkContext) (io.Writer, ld.BlockWriteCommitter, error)
Click to show internal directories.
Click to hide internal directories.