Documentation
¶
Overview ¶
Package hcache is a library providing hierarchical value store.
New value stores are created using the New function of the package, each keeping separate hierarchy of values.
cache := New()
A new value is inserted using the Insert function.
cache.Insert(42, "key1", "key2", "key3")
The value could be retrieved using the Get function.
value := cache.Get("key1", "key2", "key3")
A value could be removed from the store using the Erase function.
cache.Erase("key1", "key2", "key3")
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a store that keeps values in a hierarchical fashion.
func (*Cache) Erase ¶
Erase removes an entry from the cache following keys and returns it.
If the entry is not present in the cache Erase returns nil.
func (*Cache) GetOrInsert ¶
GetOrInsert retrieves an entry from the cache following keys.
If the entry is not present it is created with the specified value.