Documentation ¶
Index ¶
- Variables
- type BlockStatePtr
- type ByBlockId
- func (i *ByBlockId) Each(f func(key common.BlockIdType, obj BlockStatePtr))
- func (i *ByBlockId) Empty() bool
- func (i *ByBlockId) End() IteratorByBlockId
- func (i *ByBlockId) Erase(iter IteratorByBlockId)
- func (i *ByBlockId) Find(k common.BlockIdType) (IteratorByBlockId, bool)
- func (i *ByBlockId) GetFinalIndex() interface{}
- func (i *ByBlockId) GetSuperIndex() interface{}
- func (i *ByBlockId) Insert(v BlockStatePtr) (IteratorByBlockId, bool)
- func (i *ByBlockId) Modify(iter IteratorByBlockId, mod func(*BlockStatePtr)) bool
- func (i *ByBlockId) Size() int
- func (i *ByBlockId) Values() []BlockStatePtr
- type ByBlockIdNode
- type ByBlockNum
- func (tree *ByBlockNum) Begin() IteratorByBlockNum
- func (tree *ByBlockNum) Clear()
- func (tree *ByBlockNum) Empty() bool
- func (tree *ByBlockNum) End() IteratorByBlockNum
- func (tree *ByBlockNum) Erase(iter IteratorByBlockNum) (itr IteratorByBlockNum)
- func (tree *ByBlockNum) Erases(first, last IteratorByBlockNum)
- func (tree *ByBlockNum) Find(key ByBlockNumComposite) IteratorByBlockNum
- func (tree *ByBlockNum) Insert(v BlockStatePtr) (IteratorByBlockNum, bool)
- func (tree *ByBlockNum) Iterator() IteratorByBlockNum
- func (tree *ByBlockNum) Keys() []ByBlockNumComposite
- func (tree *ByBlockNum) Left() *ByBlockNumNode
- func (tree *ByBlockNum) LowerBound(key ByBlockNumComposite) IteratorByBlockNum
- func (tree *ByBlockNum) Modify(iter IteratorByBlockNum, mod func(*BlockStatePtr)) bool
- func (tree *ByBlockNum) Remove(key ByBlockNumComposite)
- func (tree *ByBlockNum) Right() *ByBlockNumNode
- func (tree *ByBlockNum) Size() int
- func (tree *ByBlockNum) String() string
- func (tree *ByBlockNum) UpperBound(key ByBlockNumComposite) IteratorByBlockNum
- func (tree *ByBlockNum) Values() []BlockStatePtr
- type ByBlockNumComposite
- type ByBlockNumNode
- type ByLibBlockNum
- func (tree *ByLibBlockNum) Begin() IteratorByLibBlockNum
- func (tree *ByLibBlockNum) Clear()
- func (tree *ByLibBlockNum) Empty() bool
- func (tree *ByLibBlockNum) End() IteratorByLibBlockNum
- func (tree *ByLibBlockNum) Erase(iter IteratorByLibBlockNum) (itr IteratorByLibBlockNum)
- func (tree *ByLibBlockNum) Erases(first, last IteratorByLibBlockNum)
- func (tree *ByLibBlockNum) Find(key ByLibBlockNumComposite) IteratorByLibBlockNum
- func (tree *ByLibBlockNum) Insert(v BlockStatePtr) (IteratorByLibBlockNum, bool)
- func (tree *ByLibBlockNum) Iterator() IteratorByLibBlockNum
- func (tree *ByLibBlockNum) Keys() []ByLibBlockNumComposite
- func (tree *ByLibBlockNum) Left() *ByLibBlockNumNode
- func (tree *ByLibBlockNum) LowerBound(key ByLibBlockNumComposite) IteratorByLibBlockNum
- func (tree *ByLibBlockNum) Modify(iter IteratorByLibBlockNum, mod func(*BlockStatePtr)) bool
- func (tree *ByLibBlockNum) Remove(key ByLibBlockNumComposite)
- func (tree *ByLibBlockNum) Right() *ByLibBlockNumNode
- func (tree *ByLibBlockNum) Size() int
- func (tree *ByLibBlockNum) String() string
- func (tree *ByLibBlockNum) UpperBound(key ByLibBlockNumComposite) IteratorByLibBlockNum
- func (tree *ByLibBlockNum) Values() []BlockStatePtr
- type ByLibBlockNumComposite
- type ByLibBlockNumNode
- type ByPrev
- func (tree *ByPrev) Begin() IteratorByPrev
- func (tree *ByPrev) Clear()
- func (tree *ByPrev) Empty() bool
- func (tree *ByPrev) End() IteratorByPrev
- func (tree *ByPrev) Erase(iter IteratorByPrev) (itr IteratorByPrev)
- func (tree *ByPrev) Erases(first, last IteratorByPrev)
- func (tree *ByPrev) Find(key common.BlockIdType) IteratorByPrev
- func (tree *ByPrev) Insert(v BlockStatePtr) (IteratorByPrev, bool)
- func (tree *ByPrev) Iterator() IteratorByPrev
- func (tree *ByPrev) Keys() []common.BlockIdType
- func (tree *ByPrev) Left() *ByPrevNode
- func (tree *ByPrev) LowerBound(key common.BlockIdType) IteratorByPrev
- func (tree *ByPrev) Modify(iter IteratorByPrev, mod func(*BlockStatePtr)) bool
- func (tree *ByPrev) Remove(key common.BlockIdType)
- func (tree *ByPrev) Right() *ByPrevNode
- func (tree *ByPrev) Size() int
- func (tree *ByPrev) String() string
- func (tree *ByPrev) UpperBound(key common.BlockIdType) IteratorByPrev
- func (tree *ByPrev) Values() []BlockStatePtr
- type ByPrevNode
- type IteratorByBlockId
- type IteratorByBlockNum
- func (iterator *IteratorByBlockNum) Begin()
- func (iterator *IteratorByBlockNum) Delete()
- func (iterator *IteratorByBlockNum) End()
- func (iterator IteratorByBlockNum) HasNext() bool
- func (iterator *IteratorByBlockNum) HasPrev() bool
- func (iterator IteratorByBlockNum) IsBegin() bool
- func (iterator IteratorByBlockNum) IsEnd() bool
- func (iterator IteratorByBlockNum) Key() ByBlockNumComposite
- func (iterator *IteratorByBlockNum) Next() bool
- func (iterator *IteratorByBlockNum) Prev() bool
- func (iterator IteratorByBlockNum) Value() BlockStatePtr
- type IteratorByLibBlockNum
- func (iterator *IteratorByLibBlockNum) Begin()
- func (iterator *IteratorByLibBlockNum) Delete()
- func (iterator *IteratorByLibBlockNum) End()
- func (iterator IteratorByLibBlockNum) HasNext() bool
- func (iterator *IteratorByLibBlockNum) HasPrev() bool
- func (iterator IteratorByLibBlockNum) IsBegin() bool
- func (iterator IteratorByLibBlockNum) IsEnd() bool
- func (iterator IteratorByLibBlockNum) Key() ByLibBlockNumComposite
- func (iterator *IteratorByLibBlockNum) Next() bool
- func (iterator *IteratorByLibBlockNum) Prev() bool
- func (iterator IteratorByLibBlockNum) Value() BlockStatePtr
- type IteratorByPrev
- func (iterator *IteratorByPrev) Begin()
- func (iterator *IteratorByPrev) Delete()
- func (iterator *IteratorByPrev) End()
- func (iterator IteratorByPrev) HasNext() bool
- func (iterator *IteratorByPrev) HasPrev() bool
- func (iterator IteratorByPrev) IsBegin() bool
- func (iterator IteratorByPrev) IsEnd() bool
- func (iterator IteratorByPrev) Key() common.BlockIdType
- func (iterator *IteratorByPrev) Next() bool
- func (iterator *IteratorByPrev) Prev() bool
- func (iterator IteratorByPrev) Value() BlockStatePtr
- type MultiIndex
- func (m *MultiIndex) Clear()
- func (m *MultiIndex) Erase(iter multiindex.IteratorType)
- func (m *MultiIndex) GetByBlockId() *ByBlockId
- func (m *MultiIndex) GetByBlockNum() *ByBlockNum
- func (m *MultiIndex) GetByLibBlockNum() *ByLibBlockNum
- func (m *MultiIndex) GetByPrev() *ByPrev
- func (m *MultiIndex) GetFinalIndex() interface{}
- func (m *MultiIndex) GetIndex() interface{}
- func (m *MultiIndex) GetSuperIndex() interface{}
- func (m *MultiIndex) Insert(v BlockStatePtr) bool
- func (m *MultiIndex) Modify(iter multiindex.IteratorType, mod func(*BlockStatePtr)) bool
- func (m *MultiIndex) Size() int
- type MultiIndexBase
- type MultiIndexBaseNode
- type MultiIndexNode
Constants ¶
This section is empty.
Variables ¶
var ByBlockIdFunc = func(n BlockStatePtr) common.BlockIdType { return n.BlockId }
var ByBlockNumCompare = func(aBlock, bBlock ByBlockNumComposite) int { if aBlock.BlockNum != nil && bBlock.BlockNum != nil { if *aBlock.BlockNum < *bBlock.BlockNum { return -1 } else if *aBlock.BlockNum > *bBlock.BlockNum { return 1 } } if aBlock.InCurrentChain != nil && bBlock.InCurrentChain != nil { if *aBlock.InCurrentChain && !*bBlock.InCurrentChain { return -1 } else if !*aBlock.InCurrentChain && *bBlock.InCurrentChain { return 1 } } return 0 }
var ByBlockNumFunc = func(n BlockStatePtr) ByBlockNumComposite { return ByBlockNumComposite{&n.BlockNum, &n.InCurrentChain} }
var ByLibBlockNumCompare = func(aBlock, bBlock ByLibBlockNumComposite) int { if aBlock.DposIrreversibleBlocknum != nil && bBlock.DposIrreversibleBlocknum != nil { if *aBlock.DposIrreversibleBlocknum > *bBlock.DposIrreversibleBlocknum { return -1 } else if *aBlock.DposIrreversibleBlocknum < *bBlock.DposIrreversibleBlocknum { return 1 } } if aBlock.BftIrreversibleBlocknum != nil && bBlock.BftIrreversibleBlocknum != nil { if *aBlock.BftIrreversibleBlocknum > *bBlock.BftIrreversibleBlocknum { return -1 } else if *aBlock.BftIrreversibleBlocknum < *bBlock.BftIrreversibleBlocknum { return 1 } } if aBlock.BlockNum != nil && bBlock.BlockNum != nil { if *aBlock.BlockNum > *bBlock.BlockNum { return -1 } else if *aBlock.BlockNum < *bBlock.BlockNum { return 1 } } return 0 }
var ByLibBlockNumFunc = func(n BlockStatePtr) ByLibBlockNumComposite { return ByLibBlockNumComposite{&n.DposIrreversibleBlocknum, &n.BftIrreversibleBlocknum, &n.BlockNum} }
var ByPrevCompare = crypto.Sha256Compare
var ByPrevFunc = func(n BlockStatePtr) common.BlockIdType { return n.Header.Previous }
Functions ¶
This section is empty.
Types ¶
type BlockStatePtr ¶
type BlockStatePtr = *types.BlockState
type ByBlockId ¶
type ByBlockId struct {
// contains filtered or unexported fields
}
func (*ByBlockId) Each ¶
func (i *ByBlockId) Each(f func(key common.BlockIdType, obj BlockStatePtr))
func (*ByBlockId) End ¶
func (i *ByBlockId) End() IteratorByBlockId
func (*ByBlockId) Erase ¶
func (i *ByBlockId) Erase(iter IteratorByBlockId)
func (*ByBlockId) Find ¶
func (i *ByBlockId) Find(k common.BlockIdType) (IteratorByBlockId, bool)
func (*ByBlockId) GetFinalIndex ¶
func (i *ByBlockId) GetFinalIndex() interface{}
func (*ByBlockId) GetSuperIndex ¶
func (i *ByBlockId) GetSuperIndex() interface{}
func (*ByBlockId) Insert ¶
func (i *ByBlockId) Insert(v BlockStatePtr) (IteratorByBlockId, bool)
func (*ByBlockId) Modify ¶
func (i *ByBlockId) Modify(iter IteratorByBlockId, mod func(*BlockStatePtr)) bool
func (*ByBlockId) Values ¶
func (i *ByBlockId) Values() []BlockStatePtr
type ByBlockIdNode ¶
type ByBlockIdNode struct {
// contains filtered or unexported fields
}
func (*ByBlockIdNode) GetFinalNode ¶
func (n *ByBlockIdNode) GetFinalNode() interface{}
func (*ByBlockIdNode) GetSuperNode ¶
func (n *ByBlockIdNode) GetSuperNode() interface{}
type ByBlockNum ¶
type ByBlockNum struct { Root *ByBlockNumNode // contains filtered or unexported fields }
OrderedIndex holds elements of the red-black tree
func (*ByBlockNum) Begin ¶
func (tree *ByBlockNum) Begin() IteratorByBlockNum
func (*ByBlockNum) Empty ¶
func (tree *ByBlockNum) Empty() bool
Empty returns true if tree does not contain any nodes
func (*ByBlockNum) End ¶
func (tree *ByBlockNum) End() IteratorByBlockNum
func (*ByBlockNum) Erase ¶
func (tree *ByBlockNum) Erase(iter IteratorByBlockNum) (itr IteratorByBlockNum)
func (*ByBlockNum) Erases ¶
func (tree *ByBlockNum) Erases(first, last IteratorByBlockNum)
func (*ByBlockNum) Find ¶
func (tree *ByBlockNum) Find(key ByBlockNumComposite) IteratorByBlockNum
Get searches the node in the tree by key and returns its value or nil if key is not found in tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*ByBlockNum) Insert ¶
func (tree *ByBlockNum) Insert(v BlockStatePtr) (IteratorByBlockNum, bool)
func (*ByBlockNum) Iterator ¶
func (tree *ByBlockNum) Iterator() IteratorByBlockNum
Iterator returns a stateful iterator whose elements are key/value pairs.
func (*ByBlockNum) Keys ¶
func (tree *ByBlockNum) Keys() []ByBlockNumComposite
Keys returns all keys in-order
func (*ByBlockNum) Left ¶
func (tree *ByBlockNum) Left() *ByBlockNumNode
Left returns the left-most (min) node or nil if tree is empty.
func (*ByBlockNum) LowerBound ¶
func (tree *ByBlockNum) LowerBound(key ByBlockNumComposite) IteratorByBlockNum
LowerBound returns an iterator pointing to the first element that is not less than the given key. Complexity: O(log N).
func (*ByBlockNum) Modify ¶
func (tree *ByBlockNum) Modify(iter IteratorByBlockNum, mod func(*BlockStatePtr)) bool
func (*ByBlockNum) Remove ¶
func (tree *ByBlockNum) Remove(key ByBlockNumComposite)
Remove remove the node from the tree by key. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*ByBlockNum) Right ¶
func (tree *ByBlockNum) Right() *ByBlockNumNode
Right returns the right-most (max) node or nil if tree is empty.
func (*ByBlockNum) Size ¶
func (tree *ByBlockNum) Size() int
Size returns number of nodes in the tree.
func (*ByBlockNum) String ¶
func (tree *ByBlockNum) String() string
String returns a string representation of container
func (*ByBlockNum) UpperBound ¶
func (tree *ByBlockNum) UpperBound(key ByBlockNumComposite) IteratorByBlockNum
UpperBound returns an iterator pointing to the first element that is greater than the given key. Complexity: O(log N).
func (*ByBlockNum) Values ¶
func (tree *ByBlockNum) Values() []BlockStatePtr
Values returns all values in-order based on the key.
type ByBlockNumComposite ¶
type ByBlockNumNode ¶
type ByBlockNumNode struct { Key ByBlockNumComposite Left *ByBlockNumNode Right *ByBlockNumNode Parent *ByBlockNumNode // contains filtered or unexported fields }
OrderedIndexNode is a single element within the tree
func (*ByBlockNumNode) String ¶
func (node *ByBlockNumNode) String() string
type ByLibBlockNum ¶
type ByLibBlockNum struct { Root *ByLibBlockNumNode // contains filtered or unexported fields }
OrderedIndex holds elements of the red-black tree
func (*ByLibBlockNum) Begin ¶
func (tree *ByLibBlockNum) Begin() IteratorByLibBlockNum
func (*ByLibBlockNum) Clear ¶
func (tree *ByLibBlockNum) Clear()
Clear removes all nodes from the tree.
func (*ByLibBlockNum) Empty ¶
func (tree *ByLibBlockNum) Empty() bool
Empty returns true if tree does not contain any nodes
func (*ByLibBlockNum) End ¶
func (tree *ByLibBlockNum) End() IteratorByLibBlockNum
func (*ByLibBlockNum) Erase ¶
func (tree *ByLibBlockNum) Erase(iter IteratorByLibBlockNum) (itr IteratorByLibBlockNum)
func (*ByLibBlockNum) Erases ¶
func (tree *ByLibBlockNum) Erases(first, last IteratorByLibBlockNum)
func (*ByLibBlockNum) Find ¶
func (tree *ByLibBlockNum) Find(key ByLibBlockNumComposite) IteratorByLibBlockNum
Get searches the node in the tree by key and returns its value or nil if key is not found in tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*ByLibBlockNum) Insert ¶
func (tree *ByLibBlockNum) Insert(v BlockStatePtr) (IteratorByLibBlockNum, bool)
func (*ByLibBlockNum) Iterator ¶
func (tree *ByLibBlockNum) Iterator() IteratorByLibBlockNum
Iterator returns a stateful iterator whose elements are key/value pairs.
func (*ByLibBlockNum) Keys ¶
func (tree *ByLibBlockNum) Keys() []ByLibBlockNumComposite
Keys returns all keys in-order
func (*ByLibBlockNum) Left ¶
func (tree *ByLibBlockNum) Left() *ByLibBlockNumNode
Left returns the left-most (min) node or nil if tree is empty.
func (*ByLibBlockNum) LowerBound ¶
func (tree *ByLibBlockNum) LowerBound(key ByLibBlockNumComposite) IteratorByLibBlockNum
LowerBound returns an iterator pointing to the first element that is not less than the given key. Complexity: O(log N).
func (*ByLibBlockNum) Modify ¶
func (tree *ByLibBlockNum) Modify(iter IteratorByLibBlockNum, mod func(*BlockStatePtr)) bool
func (*ByLibBlockNum) Remove ¶
func (tree *ByLibBlockNum) Remove(key ByLibBlockNumComposite)
Remove remove the node from the tree by key. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*ByLibBlockNum) Right ¶
func (tree *ByLibBlockNum) Right() *ByLibBlockNumNode
Right returns the right-most (max) node or nil if tree is empty.
func (*ByLibBlockNum) Size ¶
func (tree *ByLibBlockNum) Size() int
Size returns number of nodes in the tree.
func (*ByLibBlockNum) String ¶
func (tree *ByLibBlockNum) String() string
String returns a string representation of container
func (*ByLibBlockNum) UpperBound ¶
func (tree *ByLibBlockNum) UpperBound(key ByLibBlockNumComposite) IteratorByLibBlockNum
UpperBound returns an iterator pointing to the first element that is greater than the given key. Complexity: O(log N).
func (*ByLibBlockNum) Values ¶
func (tree *ByLibBlockNum) Values() []BlockStatePtr
Values returns all values in-order based on the key.
type ByLibBlockNumComposite ¶
type ByLibBlockNumNode ¶
type ByLibBlockNumNode struct { Key ByLibBlockNumComposite Left *ByLibBlockNumNode Right *ByLibBlockNumNode Parent *ByLibBlockNumNode // contains filtered or unexported fields }
OrderedIndexNode is a single element within the tree
func (*ByLibBlockNumNode) String ¶
func (node *ByLibBlockNumNode) String() string
type ByPrev ¶
type ByPrev struct { Root *ByPrevNode // contains filtered or unexported fields }
OrderedIndex holds elements of the red-black tree
func (*ByPrev) Begin ¶
func (tree *ByPrev) Begin() IteratorByPrev
func (*ByPrev) End ¶
func (tree *ByPrev) End() IteratorByPrev
func (*ByPrev) Erase ¶
func (tree *ByPrev) Erase(iter IteratorByPrev) (itr IteratorByPrev)
func (*ByPrev) Erases ¶
func (tree *ByPrev) Erases(first, last IteratorByPrev)
func (*ByPrev) Find ¶
func (tree *ByPrev) Find(key common.BlockIdType) IteratorByPrev
Get searches the node in the tree by key and returns its value or nil if key is not found in tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*ByPrev) Insert ¶
func (tree *ByPrev) Insert(v BlockStatePtr) (IteratorByPrev, bool)
func (*ByPrev) Iterator ¶
func (tree *ByPrev) Iterator() IteratorByPrev
Iterator returns a stateful iterator whose elements are key/value pairs.
func (*ByPrev) Keys ¶
func (tree *ByPrev) Keys() []common.BlockIdType
Keys returns all keys in-order
func (*ByPrev) Left ¶
func (tree *ByPrev) Left() *ByPrevNode
Left returns the left-most (min) node or nil if tree is empty.
func (*ByPrev) LowerBound ¶
func (tree *ByPrev) LowerBound(key common.BlockIdType) IteratorByPrev
LowerBound returns an iterator pointing to the first element that is not less than the given key. Complexity: O(log N).
func (*ByPrev) Modify ¶
func (tree *ByPrev) Modify(iter IteratorByPrev, mod func(*BlockStatePtr)) bool
func (*ByPrev) Remove ¶
func (tree *ByPrev) Remove(key common.BlockIdType)
Remove remove the node from the tree by key. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*ByPrev) Right ¶
func (tree *ByPrev) Right() *ByPrevNode
Right returns the right-most (max) node or nil if tree is empty.
func (*ByPrev) UpperBound ¶
func (tree *ByPrev) UpperBound(key common.BlockIdType) IteratorByPrev
UpperBound returns an iterator pointing to the first element that is greater than the given key. Complexity: O(log N).
func (*ByPrev) Values ¶
func (tree *ByPrev) Values() []BlockStatePtr
Values returns all values in-order based on the key.
type ByPrevNode ¶
type ByPrevNode struct { Key common.BlockIdType Left *ByPrevNode Right *ByPrevNode Parent *ByPrevNode // contains filtered or unexported fields }
OrderedIndexNode is a single element within the tree
func (*ByPrevNode) String ¶
func (node *ByPrevNode) String() string
type IteratorByBlockId ¶
type IteratorByBlockId struct {
// contains filtered or unexported fields
}
func (IteratorByBlockId) HasNext ¶
func (iter IteratorByBlockId) HasNext() bool
func (IteratorByBlockId) IsEnd ¶
func (iter IteratorByBlockId) IsEnd() bool
func (IteratorByBlockId) Value ¶
func (iter IteratorByBlockId) Value() (v BlockStatePtr)
type IteratorByBlockNum ¶
type IteratorByBlockNum struct {
// contains filtered or unexported fields
}
Iterator holding the iterator's state
func (*IteratorByBlockNum) Begin ¶
func (iterator *IteratorByBlockNum) Begin()
Begin resets the iterator to its initial state (one-before-first) Call Next() to fetch the first element if any.
func (*IteratorByBlockNum) Delete ¶
func (iterator *IteratorByBlockNum) Delete()
Delete remove the node which pointed by the iterator Modifies the state of the iterator.
func (*IteratorByBlockNum) End ¶
func (iterator *IteratorByBlockNum) End()
End moves the iterator past the last element (one-past-the-end). Call Prev() to fetch the last element if any.
func (IteratorByBlockNum) HasNext ¶
func (iterator IteratorByBlockNum) HasNext() bool
func (*IteratorByBlockNum) HasPrev ¶
func (iterator *IteratorByBlockNum) HasPrev() bool
func (IteratorByBlockNum) IsBegin ¶
func (iterator IteratorByBlockNum) IsBegin() bool
func (IteratorByBlockNum) IsEnd ¶
func (iterator IteratorByBlockNum) IsEnd() bool
func (IteratorByBlockNum) Key ¶
func (iterator IteratorByBlockNum) Key() ByBlockNumComposite
Key returns the current element's key. Does not modify the state of the iterator.
func (*IteratorByBlockNum) Next ¶
func (iterator *IteratorByBlockNum) Next() bool
Next moves the iterator to the next element and returns true if there was a next element in the container. If Next() returns true, then next element's key and value can be retrieved by Key() and Value(). If Next() was called for the first time, then it will point the iterator to the first element if it exists. Modifies the state of the iterator.
func (*IteratorByBlockNum) Prev ¶
func (iterator *IteratorByBlockNum) Prev() bool
Prev moves the iterator to the previous element and returns true if there was a previous element in the container. If Prev() returns true, then previous element's key and value can be retrieved by Key() and Value(). Modifies the state of the iterator.
func (IteratorByBlockNum) Value ¶
func (iterator IteratorByBlockNum) Value() BlockStatePtr
Value returns the current element's value. Does not modify the state of the iterator.
type IteratorByLibBlockNum ¶
type IteratorByLibBlockNum struct {
// contains filtered or unexported fields
}
Iterator holding the iterator's state
func (*IteratorByLibBlockNum) Begin ¶
func (iterator *IteratorByLibBlockNum) Begin()
Begin resets the iterator to its initial state (one-before-first) Call Next() to fetch the first element if any.
func (*IteratorByLibBlockNum) Delete ¶
func (iterator *IteratorByLibBlockNum) Delete()
Delete remove the node which pointed by the iterator Modifies the state of the iterator.
func (*IteratorByLibBlockNum) End ¶
func (iterator *IteratorByLibBlockNum) End()
End moves the iterator past the last element (one-past-the-end). Call Prev() to fetch the last element if any.
func (IteratorByLibBlockNum) HasNext ¶
func (iterator IteratorByLibBlockNum) HasNext() bool
func (*IteratorByLibBlockNum) HasPrev ¶
func (iterator *IteratorByLibBlockNum) HasPrev() bool
func (IteratorByLibBlockNum) IsBegin ¶
func (iterator IteratorByLibBlockNum) IsBegin() bool
func (IteratorByLibBlockNum) IsEnd ¶
func (iterator IteratorByLibBlockNum) IsEnd() bool
func (IteratorByLibBlockNum) Key ¶
func (iterator IteratorByLibBlockNum) Key() ByLibBlockNumComposite
Key returns the current element's key. Does not modify the state of the iterator.
func (*IteratorByLibBlockNum) Next ¶
func (iterator *IteratorByLibBlockNum) Next() bool
Next moves the iterator to the next element and returns true if there was a next element in the container. If Next() returns true, then next element's key and value can be retrieved by Key() and Value(). If Next() was called for the first time, then it will point the iterator to the first element if it exists. Modifies the state of the iterator.
func (*IteratorByLibBlockNum) Prev ¶
func (iterator *IteratorByLibBlockNum) Prev() bool
Prev moves the iterator to the previous element and returns true if there was a previous element in the container. If Prev() returns true, then previous element's key and value can be retrieved by Key() and Value(). Modifies the state of the iterator.
func (IteratorByLibBlockNum) Value ¶
func (iterator IteratorByLibBlockNum) Value() BlockStatePtr
Value returns the current element's value. Does not modify the state of the iterator.
type IteratorByPrev ¶
type IteratorByPrev struct {
// contains filtered or unexported fields
}
Iterator holding the iterator's state
func (*IteratorByPrev) Begin ¶
func (iterator *IteratorByPrev) Begin()
Begin resets the iterator to its initial state (one-before-first) Call Next() to fetch the first element if any.
func (*IteratorByPrev) Delete ¶
func (iterator *IteratorByPrev) Delete()
Delete remove the node which pointed by the iterator Modifies the state of the iterator.
func (*IteratorByPrev) End ¶
func (iterator *IteratorByPrev) End()
End moves the iterator past the last element (one-past-the-end). Call Prev() to fetch the last element if any.
func (IteratorByPrev) HasNext ¶
func (iterator IteratorByPrev) HasNext() bool
func (*IteratorByPrev) HasPrev ¶
func (iterator *IteratorByPrev) HasPrev() bool
func (IteratorByPrev) IsBegin ¶
func (iterator IteratorByPrev) IsBegin() bool
func (IteratorByPrev) IsEnd ¶
func (iterator IteratorByPrev) IsEnd() bool
func (IteratorByPrev) Key ¶
func (iterator IteratorByPrev) Key() common.BlockIdType
Key returns the current element's key. Does not modify the state of the iterator.
func (*IteratorByPrev) Next ¶
func (iterator *IteratorByPrev) Next() bool
Next moves the iterator to the next element and returns true if there was a next element in the container. If Next() returns true, then next element's key and value can be retrieved by Key() and Value(). If Next() was called for the first time, then it will point the iterator to the first element if it exists. Modifies the state of the iterator.
func (*IteratorByPrev) Prev ¶
func (iterator *IteratorByPrev) Prev() bool
Prev moves the iterator to the previous element and returns true if there was a previous element in the container. If Prev() returns true, then previous element's key and value can be retrieved by Key() and Value(). Modifies the state of the iterator.
func (IteratorByPrev) Value ¶
func (iterator IteratorByPrev) Value() BlockStatePtr
Value returns the current element's value. Does not modify the state of the iterator.
type MultiIndex ¶
type MultiIndex struct {
// contains filtered or unexported fields
}
func NewMultiIndex ¶
func NewMultiIndex() *MultiIndex
func (*MultiIndex) Clear ¶
func (m *MultiIndex) Clear()
func (*MultiIndex) Erase ¶
func (m *MultiIndex) Erase(iter multiindex.IteratorType)
func (*MultiIndex) GetByBlockId ¶
func (m *MultiIndex) GetByBlockId() *ByBlockId
func (*MultiIndex) GetByBlockNum ¶
func (m *MultiIndex) GetByBlockNum() *ByBlockNum
func (*MultiIndex) GetByLibBlockNum ¶
func (m *MultiIndex) GetByLibBlockNum() *ByLibBlockNum
func (*MultiIndex) GetByPrev ¶
func (m *MultiIndex) GetByPrev() *ByPrev
func (*MultiIndex) GetFinalIndex ¶
func (m *MultiIndex) GetFinalIndex() interface{}
func (*MultiIndex) GetIndex ¶
func (m *MultiIndex) GetIndex() interface{}
func (*MultiIndex) GetSuperIndex ¶
func (m *MultiIndex) GetSuperIndex() interface{}
method for MultiIndex
func (*MultiIndex) Insert ¶
func (m *MultiIndex) Insert(v BlockStatePtr) bool
func (*MultiIndex) Modify ¶
func (m *MultiIndex) Modify(iter multiindex.IteratorType, mod func(*BlockStatePtr)) bool
func (*MultiIndex) Size ¶
func (m *MultiIndex) Size() int
type MultiIndexBase ¶
type MultiIndexBase struct {
// contains filtered or unexported fields
}
/ IndexBase
func (*MultiIndexBase) GetFinalIndex ¶
func (i *MultiIndexBase) GetFinalIndex() interface{}
func (*MultiIndexBase) GetSuperIndex ¶
func (i *MultiIndexBase) GetSuperIndex() interface{}
type MultiIndexBaseNode ¶
type MultiIndexBaseNode struct {
// contains filtered or unexported fields
}
type MultiIndexNode ¶
type MultiIndexNode struct {
// contains filtered or unexported fields
}
func (*MultiIndexNode) GetFinalNode ¶
func (n *MultiIndexNode) GetFinalNode() interface{}
func (*MultiIndexNode) GetSuperNode ¶
func (n *MultiIndexNode) GetSuperNode() interface{}