Documentation
¶
Index ¶
- Constants
- func AssociationComparator(o1, o2 interface{}) int
- func Debug(value string)
- func EntryToBytes(level int, entryID uint64, uv *UniqueValue) []byte
- func Info(value string)
- func KeyComparator(o1, o2 interface{}) int
- func PointerValueComparator(o1, o2 interface{}) int
- func StringComparator(o1, o2 interface{}) int
- func UInt64Comparator(o1, o2 interface{}) int
- func UniqueAssociationComparator(o1, o2 interface{}) int
- func UniqueValueComparator(o1, o2 interface{}) int
- func ValueComparator(o1, o2 interface{}) int
- type Collection
- func (ic *Collection) Add(key string, value1 string, value2 string)
- func (ic *Collection) Delete(key string, value1 string, value2 string) (string, bool)
- func (ic *Collection) Get(key string, value1 string) (TripleSet, bool)
- func (ic *Collection) GetAssociations(value string) (*TieTree, bool)
- func (ic *Collection) GetReverseAssociations(value string) (*TieTree, bool)
- func (ic *Collection) GetTotalEntries() uint64
- func (ic *Collection) GetTripleSet(s *TieTree, value1Filter string, o SortOptions) (result TripleSet, totalCount int)
- func (ic *Collection) SimpleUpdate(key string, value1 string, newValue2 string, addOnFail bool) (string, bool)
- func (ic *Collection) Sort(tree *TieTree, value1Filter string, o SortOptions) (sorted []StringTriple, totalCount int)
- func (ic *Collection) SortByNextLevelOne(tree *TieTree, value1Filter string, o SortOptions) (sorted []StringTriple)
- func (ic *Collection) Sync()
- func (ic *Collection) Update(key string, value1 string, value2 string, newValue2 string) (string, bool)
- func (ic *Collection) UpdateAdd(key string, value1 string, value2 string, newValue2 string) (string, bool)
- func (t *Collection) WriteRandomDB(filename string)
- type CollectionKey
- type FileIndexer
- type FileMod
- type RawDataEntry
- type ReadRequest
- type Set
- type SortOptions
- type StringTriple
- type TieTree
- func (t *TieTree) Combine(tree *TieTree) (out *TieTree)
- func (tree *TieTree) Delete(key interface{})
- func (t *TieTree) Exclude(tree *TieTree) (out *TieTree)
- func (tree *TieTree) Get(key interface{}) (value interface{}, found bool)
- func (db *TieTree) GetCollection(key CollectionKey) *Collection
- func (t *TieTree) Intersect(tree *TieTree) (out *TieTree)
- func (tree *TieTree) Put(key interface{}, value interface{})
- type Triple
- type TripleSet
- type UniqueAssociation
- type UniqueValue
- type Unit
- type Value1
- type Value2
Constants ¶
View Source
const ( ENTRY_SIZE = SIZE_DATATYPE + SIZE_LEVEL + SIZE_ID + SIZE_PARENTID + SIZE_VALUE SIZE_DATATYPE = 2 SIZE_LEVEL = 8 SIZE_ID = 8 SIZE_PARENTID = SIZE_ID SIZE_VALUE = 24 // 6 * 8 - 3 * 8 MaxFreespace = 1000000 FILE_ADD = 0 FILE_DELETE = 1 // These values get written to the db files TYPE_DELETE = 10 TYPE_ENTRY = 11 TYPE_ASSOCIATION = 12 )
Variables ¶
This section is empty.
Functions ¶
func AssociationComparator ¶
func AssociationComparator(o1, o2 interface{}) int
func EntryToBytes ¶ added in v0.3.6
func EntryToBytes(level int, entryID uint64, uv *UniqueValue) []byte
func KeyComparator ¶
func KeyComparator(o1, o2 interface{}) int
func PointerValueComparator ¶
func PointerValueComparator(o1, o2 interface{}) int
func StringComparator ¶
func StringComparator(o1, o2 interface{}) int
func UInt64Comparator ¶
func UInt64Comparator(o1, o2 interface{}) int
func UniqueAssociationComparator ¶
func UniqueAssociationComparator(o1, o2 interface{}) int
func UniqueValueComparator ¶
func UniqueValueComparator(o1, o2 interface{}) int
func ValueComparator ¶
func ValueComparator(o1, o2 interface{}) int
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func (*Collection) GetAssociations ¶
func (ic *Collection) GetAssociations(value string) (*TieTree, bool)
func (*Collection) GetReverseAssociations ¶ added in v0.3.2
func (ic *Collection) GetReverseAssociations(value string) (*TieTree, bool)
func (*Collection) GetTotalEntries ¶
func (ic *Collection) GetTotalEntries() uint64
func (*Collection) GetTripleSet ¶ added in v0.1.8
func (ic *Collection) GetTripleSet(s *TieTree, value1Filter string, o SortOptions) (result TripleSet, totalCount int)
func (*Collection) SimpleUpdate ¶
func (ic *Collection) SimpleUpdate(key string, value1 string, newValue2 string, addOnFail bool) (string, bool)
Update first occurence of a value2. More expensive SimpleUpdateUsingSet - use that if udating many values
func (*Collection) Sort ¶ added in v0.3.2
func (ic *Collection) Sort(tree *TieTree, value1Filter string, o SortOptions) (sorted []StringTriple, totalCount int)
func (*Collection) SortByNextLevelOne ¶ added in v0.3.2
func (ic *Collection) SortByNextLevelOne(tree *TieTree, value1Filter string, o SortOptions) (sorted []StringTriple)
func (*Collection) Sync ¶ added in v0.3.0
func (ic *Collection) Sync()
func (*Collection) UpdateAdd ¶
func (ic *Collection) UpdateAdd(key string, value1 string, value2 string, newValue2 string) (string, bool)
Try to update value2 to newvalue2. Add if unsuccessful. TODO: Add error checking
func (*Collection) WriteRandomDB ¶
func (t *Collection) WriteRandomDB(filename string)
Used for testing worst-case scenario
type CollectionKey ¶
type FileIndexer ¶
type FileIndexer interface {
// contains filtered or unexported methods
}
type RawDataEntry ¶ added in v0.3.0
type RawDataEntry struct { Position int64 Data [ENTRY_SIZE]byte }
type ReadRequest ¶ added in v0.3.0
type SortOptions ¶ added in v0.3.2
type StringTriple ¶ added in v0.3.2
type TieTree ¶
func NewTreeWith ¶
func NewTreeWith(comparator utils.Comparator) *TieTree
func (*TieTree) GetCollection ¶
func (db *TieTree) GetCollection(key CollectionKey) *Collection
type TripleSet ¶
func (TripleSet) ForEachKey ¶
func (TripleSet) ForEachValue1 ¶
func (TripleSet) ForEachValue2 ¶
type UniqueAssociation ¶
type UniqueValue ¶
type UniqueValue struct { ParentId uint64 Value [SIZE_VALUE]byte }
type Value1 ¶
func (Value1) ForEachValue2 ¶
Click to show internal directories.
Click to hide internal directories.