models

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2021 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CIDSuffixLength = 16

CIDSuffixLength sets the length to truncate the CID in dot syntax production

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	CID          string `pg:"cid"`
	Height       uint64 `pg:"height"`
	ParentCID    string `pg:"parent_cid"`
	ParentHeight uint64 `pg:"parent_height"`
	Miner        string `pg:"miner"`
}

Block represents a single node to be visualized

func (*Block) WriteTo

func (b *Block) WriteTo(out io.Writer) (int, error)

WriteTo outputs DOT syntax to be drawn by graphviz dot. Implements the WriterTo interface.

type BlockSet

type BlockSet struct {
	// contains filtered or unexported fields
}

BlockSet represents a collection of Blocks to be visualized

func NewBlockSet

func NewBlockSet(blks []*Block) *BlockSet

NewBlockSet returns a BlockSet when given a slice of *Blocks

func (*BlockSet) WriteTo

func (bs *BlockSet) WriteTo(out io.Writer) (int, error)

WriteTo outputs DOT syntax of the BlockSet to be drawn by graphviz dot. Implements the WriterTo interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL