Documentation
¶
Index ¶
Constants ¶
const (
AccountsSnapshotNumNodesMetric = "AccountsSnapshotNumNodesMetric"
)
Variables ¶
var ErrEmptyNodeURL = errors.New("empty node URL")
ErrEmptyNodeURL signals that an empty URL for the node has been provided
var ErrInvalidAddressLength = errors.New("invalid length for the node address")
ErrInvalidAddressLength signals that an invalid length has been provided for the node's address
var ErrInvalidFetchInterval = errors.New("invalid fetch interval has been provided")
ErrInvalidFetchInterval signals that the duration in seconds between fetches is invalid
var ErrNilChanNodeIsStarting = errors.New("nil node starting channel")
ErrNilChanNodeIsStarting signals that a nil channel for node starting has been provided
var ErrNilTermuiPresenter = errors.New("nil termui presenter")
ErrNilTermuiPresenter signals that a nil termui presenter has been provided
var ErrTypeAssertionFailed = errors.New("type assertion is not possible")
ErrTypeAssertionFailed signals that a value for a metric is not an accepted one
Functions ¶
func InitLogHandler ¶
func InitLogHandler(args LogHandlerArgs) error
InitLogHandler will open the websocket and start listening to logs
func StopWebSocket ¶
func StopWebSocket()
StopWebSocket will send notify the node that the app is closed
Types ¶
type LogHandlerArgs ¶
type LogHandlerArgs struct {
Presenter PresenterHandler
NodeURL string
Profile *logger.Profile
ChanNodeIsStarting chan struct{}
UseWss bool
CustomLogProfile bool
}
LogHandlerArgs hold the arguments needed to initialize log handling
type PresenterHandler ¶
type PresenterHandler interface {
Increment(key string)
AddUint64(key string, val uint64)
Decrement(key string)
SetInt64Value(key string, value int64)
SetUInt64Value(key string, value uint64)
SetStringValue(key string, value string)
Close()
Write(p []byte) (n int, err error)
view.Presenter
}
PresenterHandler defines what a component which will handle the presentation of data in the termui should do
type StatusMetricsProvider ¶
type StatusMetricsProvider struct {
// contains filtered or unexported fields
}
StatusMetricsProvider is the struct that will handle initializing the presenter and fetching updated metrics from the node
func NewStatusMetricsProvider ¶
func NewStatusMetricsProvider( presenter PresenterHandler, nodeAddress string, fetchInterval int, ) (*StatusMetricsProvider, error)
NewStatusMetricsProvider will return a new instance of a StatusMetricsProvider
func (*StatusMetricsProvider) StartUpdatingData ¶
func (smp *StatusMetricsProvider) StartUpdatingData()
StartUpdatingData will update data from the API at a given interval