0.1.0 • Published 11 years ago
gossipmonger-memory-storage v0.1.0
gossipmonger-memory-storage
Stability: 1 - Experimental
An in-memory storage engine for Gossipmonger (an implementation of the Scuttlebutt gossip protocol endpoint for real-time peer-to-peer replication).
Installation
npm install gossipmonger-memory-storage
Tests
npm test
NOTE: There are no tests right now.
Overview
Minimalistic default in-memory storage engine for Gossipmonger.
Documentation
MemoryStorage
Public API
- new MemoryStorage()
- memoryStorage.deadPeers()
- memoryStorage.get(id)
- memoryStorage.livePeers()
- memoryStorage.put(id, peer)
new MemoryStorage()
Creates a new MemoryStorage instance.
memoryStorage.deadPeers()
- Return: Array An array of peers that are dead (
peer.live != true
).
memoryStorage.get(id)
id
: String Id of peer to get.- Return: Object Peer with given
id
orundefined
.
memoryStorage.livePeers()
- Return: Array An array of peers that are live (
peer.live == true
).
memoryStorage.put(id, peer)
id
: String Id of peer to put.peer
: Object Peer to put into storage.