view

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package view contains the frontend for the client application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderBandwidth

func RenderBandwidth(current, max int) string

Types

type GraphUpdater

type GraphUpdater interface {
	UpdateGraph(values []float64)
}

type GraphUpdaterFunc

type GraphUpdaterFunc func(values []float64)

func (GraphUpdaterFunc) UpdateGraph

func (f GraphUpdaterFunc) UpdateGraph(values []float64)

type SeriesBuilder

type SeriesBuilder struct {
	Graph      GraphUpdater
	WindowSize int
	// contains filtered or unexported fields
}

SeriesBuilder can be used to constructs inputs for a View timeseries.

func (*SeriesBuilder) Update

func (b *SeriesBuilder) Update(value float64)

type View

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

View is a text-based graphical user interface.

func New

func New() (*View, error)

func (*View) Close

func (v *View) Close()

func (*View) Print

func (v *View) Print(str string)

Print prints str in the console output widget.

func (*View) Run

func (v *View) Run(ctx context.Context) error

func (*View) UpdateClientGraph

func (v *View) UpdateClientGraph(values []float64)

UpdateClientGraph updates the historical sending rate of the client graph.

func (*View) UpdateGauge

func (v *View) UpdateGauge(bps int)

UpdateGauge reports the current sending rate (in bits per second). The rendered value is relative to the max seen sending rate across all gauges.

func (*View) UpdateServerGauge added in v0.1.2

func (v *View) UpdateServerGauge(bps int)

UpdateServerGauge reports the current receiving rate (in bits per second). The rendered value is relative to the max seen sending/receiving rate across all gauges.

func (*View) UpdateServerGraph

func (v *View) UpdateServerGraph(values []float64)

UpdateServerGraph updates the historical sending rate of the server graph.

Jump to

Keyboard shortcuts

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