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 Config
- type DummyStore
- func (a *DummyStore) AddEvidence(ctx context.Context, linkHash chainscript.LinkHash, ...) error
- func (a *DummyStore) AddStoreEventChannel(eventChan chan *store.Event)
- func (a *DummyStore) CreateLink(ctx context.Context, link *chainscript.Link) (chainscript.LinkHash, error)
- func (a *DummyStore) DeleteValue(ctx context.Context, key []byte) ([]byte, error)
- func (a *DummyStore) FindSegments(ctx context.Context, filter *store.SegmentFilter) (*types.PaginatedSegments, error)
- func (a *DummyStore) GetEvidences(ctx context.Context, linkHash chainscript.LinkHash) (types.EvidenceSlice, error)
- func (a *DummyStore) GetInfo(ctx context.Context) (interface{}, error)
- func (a *DummyStore) GetMapIDs(ctx context.Context, filter *store.MapFilter) ([]string, error)
- func (a *DummyStore) GetSegment(ctx context.Context, linkHash chainscript.LinkHash) (*chainscript.Segment, error)
- func (a *DummyStore) GetValue(ctx context.Context, key []byte) ([]byte, error)
- func (a *DummyStore) NewBatch(ctx context.Context) (store.Batch, error)
- func (a *DummyStore) SetValue(ctx context.Context, key, value []byte) error
- type Info
Constants ¶
const ( // Name is the name set in the store's information. Name = "dummystore" // Description is the description set in the store's information. Description = "Stratumn's Dummy Store" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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/go-core/store.Adapter.
func (*DummyStore) AddEvidence ¶ added in v0.2.0
func (a *DummyStore) AddEvidence(ctx context.Context, linkHash chainscript.LinkHash, evidence *chainscript.Evidence) error
AddEvidence implements github.com/stratumn/go-core/store.EvidenceWriter.AddEvidence.
func (*DummyStore) AddStoreEventChannel ¶ added in v0.2.0
func (a *DummyStore) AddStoreEventChannel(eventChan chan *store.Event)
AddStoreEventChannel implements github.com/stratumn/go-core/store.Adapter.AddStoreEventChannel
func (*DummyStore) CreateLink ¶ added in v0.2.0
func (a *DummyStore) CreateLink(ctx context.Context, link *chainscript.Link) (chainscript.LinkHash, error)
CreateLink implements github.com/stratumn/go-core/store.LinkWriter.CreateLink.
func (*DummyStore) DeleteValue ¶
DeleteValue implements github.com/stratumn/go-core/store.KeyValueStore.DeleteValue.
func (*DummyStore) FindSegments ¶
func (a *DummyStore) FindSegments(ctx context.Context, filter *store.SegmentFilter) (*types.PaginatedSegments, error)
FindSegments implements github.com/stratumn/go-core/store.Adapter.FindSegments.
func (*DummyStore) GetEvidences ¶ added in v0.2.0
func (a *DummyStore) GetEvidences(ctx context.Context, linkHash chainscript.LinkHash) (types.EvidenceSlice, error)
GetEvidences implements github.com/stratumn/go-core/store.EvidenceReader.GetEvidences.
func (*DummyStore) GetInfo ¶
func (a *DummyStore) GetInfo(ctx context.Context) (interface{}, error)
GetInfo implements github.com/stratumn/go-core/store.Adapter.GetInfo.
func (*DummyStore) GetMapIDs ¶
GetMapIDs implements github.com/stratumn/go-core/store.Adapter.GetMapIDs.
func (*DummyStore) GetSegment ¶
func (a *DummyStore) GetSegment(ctx context.Context, linkHash chainscript.LinkHash) (*chainscript.Segment, error)
GetSegment implements github.com/stratumn/go-core/store.Adapter.GetSegment.
func (*DummyStore) GetValue ¶
GetValue implements github.com/stratumn/go-core/store.KeyValueStore.GetValue.