visualizer

package
v0.2.4-0...-f8342f3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MinLen int = 5

Functions

This section is empty.

Types

type BeaconBlockPage

type BeaconBlockPage struct {
	ChainVisualizer *ChainVisualizer
	ReqPath         string
	Title           string
	HtmlFolder      string
}

BeaconBlock Page Struct

func NewBeaconBlockPage

func NewBeaconBlockPage(cv *ChainVisualizer, reqpath string, title string) (*BeaconBlockPage, error)

Generate a new BeaconBlockPage

func (*BeaconBlockPage) HandlerFunction

func (c *BeaconBlockPage) HandlerFunction(w http.ResponseWriter, r *http.Request)

Request Handler function for the new page

func (*BeaconBlockPage) Info

func (c *BeaconBlockPage) Info() string

Return the info regarding the BeaconBlockPage

func (*BeaconBlockPage) RequestPath

func (c *BeaconBlockPage) RequestPath() string

Return the RequestPath for the BeaconBlockPage

type BeaconStatePage

type BeaconStatePage struct {
	ChainVisualizer *ChainVisualizer
	ReqPath         string
	Title           string
	HtmlFolder      string
}

func NewBeaconStatePage

func NewBeaconStatePage(cv *ChainVisualizer, reqpath string, title string) (*BeaconStatePage, error)

Generate a new BeaconStatePage

func (*BeaconStatePage) HandlerFunction

func (c *BeaconStatePage) HandlerFunction(w http.ResponseWriter, r *http.Request)

Request Handler Function for the BeaconStatePage

func (*BeaconStatePage) Info

func (c *BeaconStatePage) Info() string

func (*BeaconStatePage) RequestPath

func (c *BeaconStatePage) RequestPath() string

type Buffer

type Buffer struct {
	Items    []interface{}
	WPointer int
	Len      int
	sync.RWMutex
}

func NewBuffer

func NewBuffer(length int) *Buffer

func (*Buffer) AddItem

func (c *Buffer) AddItem(item interface{}) error

func (Buffer) GetItem

func (c Buffer) GetItem(itemIdx int, item interface{}) (exists bool, ok bool)

func (Buffer) Range

func (c Buffer) Range() chan interface{}

Returns the iteration throught the items of the Buffer starting from the latest one might make more sense to start from the newest one Usage, the Range functions should be able to work with: for item := Buffer.Range() {}

type ChainVisualizer

type ChainVisualizer struct {
	BlocksBuffer Buffer
	StatesBuffer Buffer
	Pages        []VisualPage

	Ip   string
	Port string

	HtmlFolder string
}

func NewChainVisualizer

func NewChainVisualizer(length int, ip string, port string) *ChainVisualizer

Generate a new ChainVisualizer

func (*ChainVisualizer) AddNewPage

func (c *ChainVisualizer) AddNewPage(vp VisualPage) error

Add new Page to the

func (*ChainVisualizer) InitializeHost

func (c *ChainVisualizer) InitializeHost() error

Intitilize / Set up the host

type PeersPage

type PeersPage struct {
	ChainVisualizer *ChainVisualizer
	Title           string
	ReqPath         string
	HtmlFolder      string
}

func NewPeersPage

func NewPeersPage(cv *ChainVisualizer, reqpath string, title string) (*PeersPage, error)

Generate a new PeersPage

func (*PeersPage) HandlerFunction

func (c *PeersPage) HandlerFunction(w http.ResponseWriter, r http.Request)

Request Handler function for the new page

type VisualPage

type VisualPage interface {
	HandlerFunction(w http.ResponseWriter, r *http.Request)
	RequestPath() string
	Info() string
}

interface that all the pages will need to serve

Jump to

Keyboard shortcuts

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