Documentation ¶
Index ¶
- Variables
- func BlakeKeyHash(key ds.Key) string
- type Datastore
- 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) Index(key ds.Key) string
- func (d *Datastore) Put(key ds.Key, value interface{}) (err error)
- func (d *Datastore) Query(query.Query) (query.Results, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var GlobalInstance string
Currently, elastigo does not allow connecting to multiple elasticsearch instances. The elastigo API uses global static variables (ugh). See https://github.com/mattbaird/elastigo/issues/22
Thus, we use a global static variable (GlobalInstance), and return an error if NewDatastore is called twice with different addresses.
Functions ¶
func BlakeKeyHash ¶
Hash a key and return the first 16 hex chars of its blake2b hash. basically: Blake2b(key).HexString[:16]
Types ¶
type Datastore ¶
type Datastore struct { // Elastic search does not allow slashes in their object ids, // so we hash the key. By default, we use the provided BlakeKeyHash KeyHash func(ds.Key) string // contains filtered or unexported fields }
Datastore uses a standard Go map for internal storage.
func NewDatastore ¶
func (*Datastore) Index ¶
Returns the ElasticSearch index for given key. If the datastore specifies an index, use that. Else, key.Parent
Click to show internal directories.
Click to hide internal directories.