Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ErrNilTermuiPresenter = errors.New("nil termui presenter")
ErrNilTermuiPresenter signals that 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 ¶
InitLogHandler will open the websocket and set the log level
func StartListeningOnWebSocket ¶
func StartListeningOnWebSocket(presenter PresenterHandler)
StartListeningOnWebSocket will listen if a new log message is received and will display it
func StopWebSocket ¶
func StopWebSocket()
StopWebSocket will send notify the node that the app is closed
Types ¶
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