Documentation
¶
Index ¶
- type Client
- type Collection
- func (l *Collection) AddItem(label, link string) error
- func (l *Collection) All() []*Item
- func (l *Collection) AllUntyped() *[]any
- func (l *Collection) OnAdd(onAdd func(item *Item))
- func (l *Collection) OnChange(onChange func())
- func (l *Collection) OnDelete(onDelete func(item *Item))
- func (l *Collection) OnSwap(onSwap func(*Item, *Item))
- func (l *Collection) RemoveItem(del *Item)
- func (l *Collection) SwapItems(itm1 *Item, itm2 *Item) error
- type Item
- func (c *Item) Active() bool
- func (c *Item) BytesRead() int
- func (c *Item) BytesWritten() int
- func (c *Item) Connect() error
- func (c *Item) Disconnect() error
- func (c *Item) Label() string
- func (c *Item) Link() string
- func (c *Item) Read() []float64
- func (c *Item) RecordInterval() time.Duration
- func (c *Item) SetActive(active bool)
- func (c *Item) Update(link, label string) error
- func (c *Item) Written() []float64
- func (c *Item) XRayConfig() map[string]string
- type NetworkRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection represents a collection of items. Is used to easily pass events and update the UI state in one place (on{*} methods).
func New ¶
func New() *Collection
func (*Collection) AddItem ¶
func (l *Collection) AddItem(label, link string) error
func (*Collection) All ¶
func (l *Collection) All() []*Item
func (*Collection) AllUntyped ¶
func (l *Collection) AllUntyped() *[]any
func (*Collection) OnAdd ¶
func (l *Collection) OnAdd(onAdd func(item *Item))
func (*Collection) OnChange ¶
func (l *Collection) OnChange(onChange func())
func (*Collection) OnDelete ¶
func (l *Collection) OnDelete(onDelete func(item *Item))
OnDelete note: provided method is called before the actual deletion of the item.
func (*Collection) OnSwap ¶ added in v0.0.2
func (l *Collection) OnSwap(onSwap func(*Item, *Item))
func (*Collection) RemoveItem ¶
func (l *Collection) RemoveItem(del *Item)
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item is a combine that is passed (via interface segregation) throughout the system to apply centralized changes to connections with the smallest overhead as possible.
func (*Item) BytesWritten ¶
func (*Item) Disconnect ¶
func (*Item) RecordInterval ¶
func (*Item) XRayConfig ¶
type NetworkRecorder ¶
type NetworkRecorder interface { // Start should start recording data. Start() // Read should return values for uplink for each previous RecordInterval. // Number of values returned must match Written. Read() []float64 // Written should return values for downlink for each previous RecordInterval. // Number of values returned must match Written. Written() []float64 // BytesRead should return the total number of bytes for uplink. BytesRead() int // BytesWritten should return the total number of bytes for downlink. BytesWritten() int RecordInterval() time.Duration }
Click to show internal directories.
Click to hide internal directories.