Documentation ¶
Overview ¶
Package filestore implements a store that saves all the segments to the file system.
The segments are stored as JSON files named after the link hashes. It's a convenient store to use during the development of an agent. However, because it doesn't use an index, it's very slow, and shouldn't be used for production.
Index ¶
- Constants
- type Batch
- type Config
- type FileStore
- func (a *FileStore) AddEvidence(ctx context.Context, linkHash *types.Bytes32, evidence *cs.Evidence) error
- func (a *FileStore) AddStoreEventChannel(eventChan chan *store.Event)
- func (a *FileStore) CreateLink(ctx context.Context, link *cs.Link) (*types.Bytes32, error)
- func (a *FileStore) DeleteValue(ctx context.Context, key []byte) ([]byte, error)
- func (a *FileStore) FindSegments(ctx context.Context, filter *store.SegmentFilter) (cs.SegmentSlice, error)
- func (a *FileStore) GetEvidences(ctx context.Context, linkHash *types.Bytes32) (*cs.Evidences, error)
- func (a *FileStore) GetInfo(ctx context.Context) (interface{}, error)
- func (a *FileStore) GetMapIDs(ctx context.Context, filter *store.MapFilter) ([]string, error)
- func (a *FileStore) GetSegment(ctx context.Context, linkHash *types.Bytes32) (*cs.Segment, error)
- func (a *FileStore) GetValue(ctx context.Context, key []byte) ([]byte, error)
- func (a *FileStore) NewBatch(ctx context.Context) (store.Batch, error)
- func (a *FileStore) SetValue(ctx context.Context, key []byte, value []byte) error
- type Info
Constants ¶
const ( // Name is the name set in the store's information. Name = "file" // Description is the description set in the store's information. Description = "Indigo's File Store" // DefaultPath is the path where segments will be saved by default. DefaultPath = "/var/stratumn/filestore" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct { *bufferedbatch.Batch // contains filtered or unexported fields }
Batch is the type that implements github.com/stratumn/go-indigocore/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 // Path where segments will be saved. Path string }
Config contains configuration options for the store.
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore is the type that implements github.com/stratumn/go-indigocore/store.Adapter.
func (*FileStore) AddEvidence ¶ added in v0.2.0
func (a *FileStore) AddEvidence(ctx context.Context, linkHash *types.Bytes32, evidence *cs.Evidence) error
AddEvidence implements github.com/stratumn/go-indigocore/store.EvidenceWriter.AddEvidence.
func (*FileStore) AddStoreEventChannel ¶ added in v0.2.0
AddStoreEventChannel implements github.com/stratumn/go-indigocore/store.Adapter.AddStoreEventChannel
func (*FileStore) CreateLink ¶ added in v0.2.0
CreateLink implements github.com/stratumn/go-indigocore/store.LinkWriter.CreateLink.
func (*FileStore) DeleteValue ¶
DeleteValue implements github.com/stratumn/go-indigocore/store.KeyValueStore.DeleteValue.
func (*FileStore) FindSegments ¶
func (a *FileStore) FindSegments(ctx context.Context, filter *store.SegmentFilter) (cs.SegmentSlice, error)
FindSegments implements github.com/stratumn/go-indigocore/store.SegmentReader.FindSegments.
func (*FileStore) GetEvidences ¶ added in v0.2.0
func (a *FileStore) GetEvidences(ctx context.Context, linkHash *types.Bytes32) (*cs.Evidences, error)
GetEvidences implements github.com/stratumn/go-indigocore/store.EvidenceReader.GetEvidences.
func (*FileStore) GetInfo ¶
GetInfo implements github.com/stratumn/go-indigocore/store.Adapter.GetInfo.
func (*FileStore) GetMapIDs ¶
GetMapIDs implements github.com/stratumn/go-indigocore/store.SegmentReader.GetMapIDs.
func (*FileStore) GetSegment ¶
GetSegment implements github.com/stratumn/go-indigocore/store.SegmentReader.GetSegment.
func (*FileStore) GetValue ¶
GetValue implements github.com/stratumn/go-indigocore/store.KeyValueStore.GetValue.