Documentation ¶
Overview ¶
Package mapstate implements the State interface for IPFS Cluster by using a map to keep track of the consensus-shared state.
Index ¶
Constants ¶
View Source
const Version = 2
Version is the map state Version. States with old versions should perform an upgrade before.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MapState ¶
type MapState struct { PinMap map[string]api.PinSerial Version int // contains filtered or unexported fields }
MapState is a very simple database to store the state of the system using a Go map. It is thread safe. It implements the State interface.
func NewMapState ¶
func NewMapState() *MapState
NewMapState initializes the internal map and returns a new MapState object.
func (*MapState) Restore ¶ added in v0.0.11
Restore takes a reader and restores a snapshot. It should migrate the format if it is not compatible with the current version.
Click to show internal directories.
Click to hide internal directories.