dummystore

package
v0.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 9 Imported by: 4

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

View Source
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 New

func New(config *Config) *DummyStore

New creates an instance of a DummyStore.

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 (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

func (a *DummyStore) DeleteValue(ctx context.Context, key []byte) ([]byte, error)

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

func (a *DummyStore) GetMapIDs(ctx context.Context, filter *store.MapFilter) ([]string, error)

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

func (a *DummyStore) GetValue(ctx context.Context, key []byte) ([]byte, error)

GetValue implements github.com/stratumn/go-core/store.KeyValueStore.GetValue.

func (*DummyStore) NewBatch

func (a *DummyStore) NewBatch(ctx context.Context) (store.Batch, error)

NewBatch implements github.com/stratumn/go-core/store.Adapter.NewBatch.

func (*DummyStore) SetValue added in v0.2.0

func (a *DummyStore) SetValue(ctx context.Context, key, value []byte) error

SetValue implements github.com/stratumn/go-core/store.KeyValueStore.SetValue.

type Info

type Info struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Version     string `json:"version"`
	Commit      string `json:"commit"`
}

Info is the info returned by GetInfo.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL