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 Config
- type FileStore
- func (a *FileStore) DeleteSegment(linkHash *types.Bytes32) (*cs.Segment, error)
- func (a *FileStore) FindSegments(filter *store.Filter) (cs.SegmentSlice, error)
- func (a *FileStore) GetInfo() (interface{}, error)
- func (a *FileStore) GetMapIDs(pagination *store.Pagination) ([]string, error)
- func (a *FileStore) GetSegment(linkHash *types.Bytes32) (*cs.Segment, error)
- func (a *FileStore) SaveSegment(segment *cs.Segment) 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 = "Stratumn 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 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/store.Adapter.
func (*FileStore) DeleteSegment ¶
DeleteSegment implements github.com/stratumn/go/store.Adapter.DeleteSegment.
func (*FileStore) FindSegments ¶
FindSegments implements github.com/stratumn/go/store.Adapter.FindSegments.
func (*FileStore) GetMapIDs ¶
func (a *FileStore) GetMapIDs(pagination *store.Pagination) ([]string, error)
GetMapIDs implements github.com/stratumn/go/store.Adapter.GetMapIDs.
func (*FileStore) GetSegment ¶
GetSegment implements github.com/stratumn/go/store.Adapter.GetSegment.