Categorygithub.com/vulcanize/go-datastore
modulepackage
1.4.1
Repository: https://github.com/vulcanize/go-datastore.git
Documentation: pkg.go.dev

# README

go-datastore

standard-readme compliant GoDoc

key-value datastore interfaces

datastore is a generic layer of abstraction for data store and database access. It is a simple API with the aim to enable application development in a datastore-agnostic way, allowing datastores to be swapped seamlessly without changing application code. Thus, one can leverage different datastores with different strengths without committing the application to one datastore throughout its lifetime.

In addition, grouped datastores significantly simplify interesting data access patterns (such as caching and sharding).

Based on datastore.py.

Documentation

https://godoc.org/github.com/ipfs/go-datastore

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

Want to hack on IPFS?

License

MIT

# Packages

No description provided by the author
No description provided by the author
Package fs is a simple Datastore implementation that stores keys are directories and files, mirroring the key.
Package keytransform introduces a Datastore Shim that transforms keys before passing them to its child.
Package mount provides a Datastore that has other Datastores mounted at various key prefixes.
Package namespace introduces a namespace Datastore Shim, which basically mounts the entire child datastore under a prefix.
No description provided by the author
No description provided by the author
No description provided by the author
Package mount provides a Datastore that has other Datastores mounted at various key prefixes and is threadsafe.
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

EntryKeys.
GetBackedHas provides a default Datastore.Has implementation.
KeyWithNamespaces constructs a key out of a namespace slice.
NamespaceType is the first component of a namespace.
NamespaceValue returns the last component of a namespace.
No description provided by the author
NewKey constructs a key from string.
NewLogDatastore constructs a log datastore.
NewMapDatastore constructs a MapDatastore.
NewNullDatastore constructs a null datastoe.
RandomKey returns a randomly (uuid) generated key.
RawKey creates a new Key without safety checking the input.

# Variables

No description provided by the author
ErrInvalidType is returned by Put when a given value is incopatible with the type the datastore supports.
ErrNotFound is returned by Get, Has, and Delete when a datastore does not map the given key to a value.

# Structs

A Key represents the unique identifier of an object.
LogBatch logs all accesses through the batch.
LogDatastore logs all accesses through the datastore.
MapDatastore uses a standard Go map for internal storage.
NullDatastore stores nothing, but conforms to the API.

# Interfaces

No description provided by the author
No description provided by the author
CheckedDatastore is an interface that should be implemented by datastores which may need checking on-disk data integrity.
Datastore represents storage for any key-value pair.
GCDatastore is an interface that should be implemented by datastores which don't free disk space by just removing data from them.
CheckedDatastore is an interface that should be implemented by datastores which want to provide a mechanism to check data integrity and/or error correction.
Shim is a datastore which has a child.
ThreadSafeDatastore is an interface that all threadsafe datastore should implement to leverage type safety checks.

# Type aliases

KeySlice attaches the methods of sort.Interface to []Key, sorting in increasing order.