Versions in this module Expand all Collapse all v0 v0.1.3 Oct 3, 2023 v0.1.2 Oct 3, 2023 Changes in this version + const ElementIDLength + var ErrInsufficientMana = errors.New("insufficient node's mana to schedule the block") + type AccessManaCache struct + func NewAccessManaCache(accessManaMapRetrieverFunc func() map[identity.ID]float64, ...) *AccessManaCache + func (a *AccessManaCache) GetCachedMana(id identity.ID) float64 + func (a *AccessManaCache) GetCachedTotalMana() float64 + func (a *AccessManaCache) RawAccessManaVector() map[identity.ID]float64 + func (a *AccessManaCache) RefreshCacheIfNecessary() + type BufferQueue struct + func NewBufferQueue(maxBuffer int, maxQueue float64) *BufferQueue + func (b *BufferQueue) Current() *NodeQueue + func (b *BufferQueue) IDs() (ids []ElementID) + func (b *BufferQueue) InsertNode(nodeID identity.ID) + func (b *BufferQueue) MaxSize() int + func (b *BufferQueue) Next() *NodeQueue + func (b *BufferQueue) NodeIDs() []identity.ID + func (b *BufferQueue) NodeQueue(nodeID identity.ID) *NodeQueue + func (b *BufferQueue) NumActiveNodes() int + func (b *BufferQueue) PopFront() Element + func (b *BufferQueue) Ready(blk Element) bool + func (b *BufferQueue) ReadyBlocksCount() (readyBlkCount int) + func (b *BufferQueue) RemoveNode(nodeID identity.ID) + func (b *BufferQueue) Size() int + func (b *BufferQueue) Submit(blk Element, accessManaRetriever func(identity.ID) float64) (elements []ElementID, err error) + func (b *BufferQueue) TotalBlocksCount() (blkCount int) + func (b *BufferQueue) Unsubmit(blk Element) bool + type Element interface + IDBytes func() []byte + IssuerPublicKey func() ed25519.PublicKey + IssuingTime func() time.Time + Size func() int + type ElementHeap []Element + func (h *ElementHeap) Pop() interface{} + func (h *ElementHeap) Push(x interface{}) + func (h ElementHeap) Len() int + func (h ElementHeap) Less(i, j int) bool + func (h ElementHeap) Swap(i, j int) + type ElementID [ElementIDLength]byte + func ElementIDFromBytes(data []byte) (result ElementID) + func (e ElementID) Bytes() []byte + type NodeQueue struct + func NewNodeQueue(nodeID identity.ID) *NodeQueue + func (q *NodeQueue) Front() Element + func (q *NodeQueue) IDs() (ids []ElementID) + func (q *NodeQueue) NodeID() identity.ID + func (q *NodeQueue) PopFront() Element + func (q *NodeQueue) Ready(element Element) bool + func (q *NodeQueue) Size() int + func (q *NodeQueue) Submit(element Element) bool + func (q *NodeQueue) Unsubmit(element Element) bool