Versions in this module Expand all Collapse all v1 v1.0.1 Jun 17, 2021 v1.0.0 Mar 26, 2021 Changes in this version + const PREFIX + const README_FN + const SHARDING_FN + const SyncThreadsMax + var ErrDatastoreDoesNotExist = errors.New("datastore directory does not exist") + var ErrDatastoreExists = errors.New("datastore already exist") + var ErrShardingFileMissing = fmt.Errorf("%s file not found in datastore", SHARDING_FN) + var IPFS_DEF_SHARD = NextToLast(2) + var IPFS_DEF_SHARD_STR = IPFS_DEF_SHARD.String() + var README_IPFS_DEF_SHARD = ... + func Create(path string, fun *ShardIdV1) error + func DirIsEmpty(name string) (bool, error) + func DowngradeV1toV0(path string) error + func Move(oldPath string, newPath string, out io.Writer) error + func UpgradeV0toV1(path string, prefixLen int) error + func WriteReadme(dir string, id *ShardIdV1) error + func WriteShardFunc(dir string, id *ShardIdV1) error + type Datastore struct + func CreateOrOpen(path string, fun *ShardIdV1, sync bool) (*Datastore, error) + func Open(path string, sync bool) (*Datastore, error) + func (*Datastore) IsThreadSafe() + func (fs *Datastore) Batch() (datastore.Batch, error) + func (fs *Datastore) Close() error + func (fs *Datastore) Delete(key datastore.Key) error + func (fs *Datastore) Get(key datastore.Key) (value interface{}, err error) + func (fs *Datastore) Has(key datastore.Key) (exists bool, err error) + func (fs *Datastore) Put(key datastore.Key, value interface{}) error + func (fs *Datastore) Query(q query.Query) (query.Results, error) + func (fs *Datastore) ShardStr() string + type ShardFunc func(string) string + type ShardIdV1 struct + func NextToLast(suffixLen int) *ShardIdV1 + func ParseShardFunc(str string) (*ShardIdV1, error) + func Prefix(prefixLen int) *ShardIdV1 + func ReadShardFunc(dir string) (*ShardIdV1, error) + func Suffix(suffixLen int) *ShardIdV1 + func (f *ShardIdV1) Func() ShardFunc + func (f *ShardIdV1) String() string