Documentation ¶
Overview ¶
Package dummystore implements a store that saves all the segments in memory.
It can be used for testing, but it's unoptimized and not designed for production.
Index ¶
- Constants
- type Batch
- type Config
- type DummyStore
- func (a *DummyStore) AddDidSaveChannel(saveChan chan *cs.Segment)
- func (a *DummyStore) DeleteSegment(linkHash *types.Bytes32) (*cs.Segment, error)
- func (a *DummyStore) DeleteValue(key []byte) ([]byte, error)
- func (a *DummyStore) FindSegments(filter *store.SegmentFilter) (cs.SegmentSlice, error)
- func (a *DummyStore) GetInfo() (interface{}, error)
- func (a *DummyStore) GetMapIDs(filter *store.MapFilter) ([]string, error)
- func (a *DummyStore) GetSegment(linkHash *types.Bytes32) (*cs.Segment, error)
- func (a *DummyStore) GetValue(key []byte) ([]byte, error)
- func (a *DummyStore) NewBatch() (store.Batch, error)
- func (a *DummyStore) SaveSegment(segment *cs.Segment) error
- func (a *DummyStore) SaveValue(key, value []byte) error
- type Info
Constants ¶
const ( // Name is the name set in the store's information. Name = "dummy" // Description is the description set in the store's information. Description = "Stratumn Dummy Store" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct { *store.BufferedBatch // contains filtered or unexported fields }
Batch is the type that implements github.com/stratumn/sdk/store.Batch.
type Config ¶
type Config struct { // A version string that will be set in the store's information. Version string // A git commit hash that will be set in the store's information. Commit string }
Config contains configuration options for the store.
type DummyStore ¶
type DummyStore struct {
// contains filtered or unexported fields
}
DummyStore is the type that implements github.com/stratumn/sdk/store.Adapter.
func (*DummyStore) AddDidSaveChannel ¶
func (a *DummyStore) AddDidSaveChannel(saveChan chan *cs.Segment)
AddDidSaveChannel implements github.com/stratumn/sdk/fossilizer.Store.AddDidSaveChannel.
func (*DummyStore) DeleteSegment ¶
DeleteSegment implements github.com/stratumn/sdk/store.Adapter.DeleteSegment.
func (*DummyStore) DeleteValue ¶
func (a *DummyStore) DeleteValue(key []byte) ([]byte, error)
DeleteValue implements github.com/stratumn/sdk/store.Adapter.DeleteValue.
func (*DummyStore) FindSegments ¶
func (a *DummyStore) FindSegments(filter *store.SegmentFilter) (cs.SegmentSlice, error)
FindSegments implements github.com/stratumn/sdk/store.Adapter.FindSegments.
func (*DummyStore) GetInfo ¶
func (a *DummyStore) GetInfo() (interface{}, error)
GetInfo implements github.com/stratumn/sdk/store.Adapter.GetInfo.
func (*DummyStore) GetMapIDs ¶
func (a *DummyStore) GetMapIDs(filter *store.MapFilter) ([]string, error)
GetMapIDs implements github.com/stratumn/sdk/store.Adapter.GetMapIDs.
func (*DummyStore) GetSegment ¶
GetSegment implements github.com/stratumn/sdk/store.Adapter.GetSegment.
func (*DummyStore) GetValue ¶
func (a *DummyStore) GetValue(key []byte) ([]byte, error)
GetValue implements github.com/stratumn/sdk/store.Adapter.GetValue.
func (*DummyStore) NewBatch ¶
func (a *DummyStore) NewBatch() (store.Batch, error)
NewBatch implements github.com/stratumn/sdk/store.Adapter.NewBatch.
func (*DummyStore) SaveSegment ¶
func (a *DummyStore) SaveSegment(segment *cs.Segment) error
SaveSegment implements github.com/stratumn/sdk/store.Adapter.SaveSegment.
func (*DummyStore) SaveValue ¶
func (a *DummyStore) SaveValue(key, value []byte) error
SaveValue implements github.com/stratumn/sdk/store.Adapter.SaveValue.