models

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphView

type GraphView struct {
	*tview.Box
	Connections []*WebsocketData
	Counter     *MsgCounter
	// contains filtered or unexported fields
}

func NewGraphView

func NewGraphView() *GraphView

func (*GraphView) Draw

func (g *GraphView) Draw(screen tcell.Screen)

func (*GraphView) GetLastEntries

func (g *GraphView) GetLastEntries(num int) []uint64

func (*GraphView) GetSize

func (g *GraphView) GetSize() int

type InfoBox

type InfoBox struct {
	*tview.Box

	Connections []*WebsocketData
	MsgCounter  *MsgCounter
	Addr        string
	// contains filtered or unexported fields
}

func NewInfoBox

func NewInfoBox() *InfoBox

func (*InfoBox) Draw

func (i *InfoBox) Draw(screen tcell.Screen)

func (*InfoBox) GetActiveConnections

func (i *InfoBox) GetActiveConnections() (total int)

type Logger

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

func NewLogger

func NewLogger() *Logger

func (*Logger) GetLastEntries

func (l *Logger) GetLastEntries(num int) []string

func (*Logger) GetLastEntry

func (l *Logger) GetLastEntry() string

func (*Logger) GetSize

func (l *Logger) GetSize() int

func (*Logger) Log

func (l *Logger) Log(text string)

Log adds a new entry to the logger.

func (*Logger) String

func (l *Logger) String() string

func (*Logger) Write added in v1.2.0

func (l *Logger) Write(p []byte) (n int, err error)

Write implements the io.Writer interface.

type LoggerView

type LoggerView struct {
	*tview.Box
	Logger *Logger
}

func NewLoggerView

func NewLoggerView() *LoggerView

func (LoggerView) Draw

func (l LoggerView) Draw(screen tcell.Screen)

type MsgCounter

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

func NewMsgCounter

func NewMsgCounter(counterRate int64) *MsgCounter

func (*MsgCounter) Count

func (m *MsgCounter) Count() uint64

func (*MsgCounter) Incr

func (m *MsgCounter) Incr()

func (*MsgCounter) Rate

func (m *MsgCounter) Rate() uint64

func (*MsgCounter) Set

func (m *MsgCounter) Set(value uint64)

type WebsocketData

type WebsocketData struct {
	ID int

	Connected bool
	// contains filtered or unexported fields
}

func NewWebsocketData

func NewWebsocketData(id int, counter *MsgCounter) *WebsocketData

func (*WebsocketData) IncCounter

func (w *WebsocketData) IncCounter()

func (*WebsocketData) MessageCount

func (w *WebsocketData) MessageCount() uint64

type WebsocketView

type WebsocketView struct {
	*tview.Box
	Connections    []*WebsocketData
	WebsocketCount int
}

WebsocketView is the full view that contains all the individual websocket boxes

func NewWebsocketView

func NewWebsocketView(websocketCount int) *WebsocketView

func (WebsocketView) Draw

func (w WebsocketView) Draw(screen tcell.Screen)

Jump to

Keyboard shortcuts

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