output

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package output provides output formatting for CLI results

Index

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

func PrintVersion(version, gitCommit, buildTime string, checkLatest bool)

PrintVersion outputs version information

func ValidateFormat

func ValidateFormat(format string) error

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

type Formatter struct {
	Format    string
	Color     bool
	NoHeaders bool
}

Formatter handles output formatting

func NewFormatter

func NewFormatter(format, color string, noHeaders bool) *Formatter

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) PrintJSON

func (f *Formatter) PrintJSON(data interface{}) error

PrintJSON outputs data as formatted JSON

func (*Formatter) PrintNetworksTable

func (f *Formatter) PrintNetworksTable(networks []NetworkData)

PrintNetworksTable outputs networks in table format

func (*Formatter) PrintSitesTable

func (f *Formatter) PrintSitesTable(sites []SiteData)

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

type NetworkData

type NetworkData struct {
	ID      string
	Name    string
	Purpose string
	VLAN    int
	Subnet  string
	Enabled bool
	IsGuest bool
}

NetworkData holds network information for table output

type SiteData

type SiteData struct {
	ID          string
	Name        string
	Description string
	Devices     int
	Clients     int
}

SiteData holds site information for table output

Jump to

Keyboard shortcuts

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