Documentation ¶
Overview ¶
Storage contains some simple implementations for the ipld.BlockReadOpener and ipld.BlockWriteOpener interfaces, which are typically used by composition in a LinkSystem.
These are provided as simple "batteries included" storage systems. They are aimed at being quickly usable to build simple demonstrations. For heavy usage (large datasets, with caching, etc) you'll probably want to start looking for other libraries which go deeper on this subject.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Memory ¶
type Memory struct {
Bag map[ipld.Link][]byte
}
Memory is a simple in-memory storage for data indexed by ipld.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 ipld.BlockReadOpener, and the OpenWrite method conforms to ipld.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.