Documentation
¶
Overview ¶
Package output provides output formatting for CLI results
Index ¶
- func PrintInitSuccess(configPath string)
- func PrintVersion(version, gitCommit, buildTime string, checkLatest bool)
- func ValidateFormat(format string) error
- type BandwidthClientData
- type BandwidthDeviceData
- type ClientData
- type DeviceData
- type FirewallRuleData
- type Formatter
- func (f *Formatter) PrintBandwidthClientsTable(clients []BandwidthClientData)
- func (f *Formatter) PrintBandwidthDevicesTable(devices []BandwidthDeviceData, totalDownload, totalUpload string)
- func (f *Formatter) PrintClientsTable(clients []ClientData)
- func (f *Formatter) PrintDevicesTable(devices []DeviceData)
- func (f *Formatter) PrintFirewallRulesTable(rules []FirewallRuleData)
- func (f *Formatter) PrintHealthTable(subsystems []HealthSubsystemData)
- func (f *Formatter) PrintJSON(data interface{}) error
- func (f *Formatter) PrintNetworksTable(networks []NetworkData)
- func (f *Formatter) PrintSitesTable(sites []SiteData)
- type HealthSubsystemData
- type NetworkData
- type SiteData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintInitSuccess ¶
func PrintInitSuccess(configPath string)
PrintInitSuccess outputs a success message after init
func PrintVersion ¶
PrintVersion outputs version information
func ValidateFormat ¶
ValidateFormat checks if the format is supported
Types ¶
type BandwidthClientData ¶ added in v0.0.3
type BandwidthClientData struct {
Name string
IP string
Device string
Download string
Upload string
IsWired bool
}
BandwidthClientData holds bandwidth information for a client
type BandwidthDeviceData ¶ added in v0.0.3
type BandwidthDeviceData struct {
Name string
MAC string
Model string
Download string
Upload string
Percentage float64
}
BandwidthDeviceData holds bandwidth information for a device
type ClientData ¶
type ClientData struct {
MAC string
Name string
IP string
AP string
IsWired bool
Signal int
LastSeen int
}
ClientData holds client information for table output
type DeviceData ¶
type DeviceData struct {
MAC string
Name string
Model string
Type string
Status string
IP string
Adopted bool
Uptime int
LastSeen int
}
DeviceData holds device information for table output
type FirewallRuleData ¶
type FirewallRuleData struct {
ID string
Name string
Action string
Protocol string
SrcAddr string
DstAddr string
DstPort string
RuleSet string
Enabled bool
}
FirewallRuleData holds firewall rule information for table output
type Formatter ¶
Formatter handles output formatting
func NewFormatter ¶
NewFormatter creates a new output formatter
func (*Formatter) PrintBandwidthClientsTable ¶ added in v0.0.3
func (f *Formatter) PrintBandwidthClientsTable(clients []BandwidthClientData)
PrintBandwidthClientsTable outputs client bandwidth in table format
func (*Formatter) PrintBandwidthDevicesTable ¶ added in v0.0.3
func (f *Formatter) PrintBandwidthDevicesTable(devices []BandwidthDeviceData, totalDownload, totalUpload string)
PrintBandwidthDevicesTable outputs device bandwidth in table format
func (*Formatter) PrintClientsTable ¶
func (f *Formatter) PrintClientsTable(clients []ClientData)
PrintClientsTable outputs clients in table format
func (*Formatter) PrintDevicesTable ¶
func (f *Formatter) PrintDevicesTable(devices []DeviceData)
PrintDevicesTable outputs devices in table format
func (*Formatter) PrintFirewallRulesTable ¶
func (f *Formatter) PrintFirewallRulesTable(rules []FirewallRuleData)
PrintFirewallRulesTable outputs firewall rules in table format
func (*Formatter) PrintHealthTable ¶
func (f *Formatter) PrintHealthTable(subsystems []HealthSubsystemData)
PrintHealthTable outputs health subsystems in table format
func (*Formatter) PrintNetworksTable ¶
func (f *Formatter) PrintNetworksTable(networks []NetworkData)
PrintNetworksTable outputs networks in table format
func (*Formatter) PrintSitesTable ¶
PrintSitesTable outputs sites in table format
type HealthSubsystemData ¶
type HealthSubsystemData struct {
Subsystem string
Status string
NumAdopted int
NumDisconnected int
NumPending int
}
HealthSubsystemData holds health subsystem information for table output