Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBStack ¶
type DBStack struct {
// contains filtered or unexported fields
}
DBStack allows performing basic stack operations on a stack of meshdb.MiniHeaders stored in the DB backing our meshdb package.
func New ¶
New instantiates a new stack with the specified size limit. Once the size limit is reached, adding additional blocks will evict the deepest block.
func (*DBStack) Peek ¶
func (b *DBStack) Peek() (*miniheader.MiniHeader, error)
Peek returns the latest block header from the block stack without removing it. It returns nil if the stack is empty.
func (*DBStack) PeekAll ¶
func (b *DBStack) PeekAll() ([]*miniheader.MiniHeader, error)
PeekAll returns all the block headers currently on the stack
func (*DBStack) Pop ¶
func (b *DBStack) Pop() (*miniheader.MiniHeader, error)
Pop removes and returns the latest block header on the block stack. It returns nil if the stack is empty.
func (*DBStack) Push ¶
func (b *DBStack) Push(block *miniheader.MiniHeader) error
Push pushes a block header onto the block stack. If the stack limit is reached, it will remove the oldest block header.