Documentation ¶
Overview ¶
Package fs is a simple Datastore implementation that stores keys are directories and files, mirroring the key. That is, the key "/foo/bar" is stored as file "PATH/foo/bar/.dsobject".
This means key some segments will not work. For example, the following keys will result in unwanted behavior:
- "/foo/./bar"
- "/foo/../bar"
- "/foo\x00bar"
Keys that only differ in case may be confused with each other on case insensitive file systems, for example in OS X.
This package is intended for exploratory use, where the user would examine the file system manually, and should only be used with human-friendly, trusted keys. You have been warned.
Index ¶
- Variables
- func NewDatastore(path string) (ds.Datastore, error)
- type Datastore
- func (d *Datastore) Batch() (ds.Batch, error)
- func (d *Datastore) Close() error
- func (d *Datastore) Delete(key ds.Key) (err error)
- func (d *Datastore) Get(key ds.Key) (value interface{}, err error)
- func (d *Datastore) Has(key ds.Key) (exists bool, err error)
- func (d *Datastore) KeyFilename(key ds.Key) string
- func (d *Datastore) Put(key ds.Key, value interface{}) (err error)
- func (d *Datastore) Query(q query.Query) (query.Results, error)
Constants ¶
This section is empty.
Variables ¶
var ObjectKeySuffix = ".dsobject"
Functions ¶
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore uses a uses a file per key to store values.
func (*Datastore) KeyFilename ¶
KeyFilename returns the filename associated with `key`