Documentation
¶
Index ¶
- Variables
- func MapBool(m map[string]any, key string) bool
- func MapInt(m map[string]any, key string) int
- func MapList(m map[string]any, key string) []any
- func MapMap(m map[string]any, key string) (map[string]any, bool)
- func MapPtrBool(m map[string]any, key string) *bool
- func MapPtrFloat(m map[string]any, key string) *float64
- func MapPtrInt(m map[string]any, key string) *int
- func MapPtrStr(m map[string]any, key string) *string
- func MapStr(m map[string]any, key string) string
- func MapStrList(m map[string]any, key string) []string
- func ValidateVlanConflicts(payload map[string]any, networks []LanNetwork, excludeID *string) error
- func ValidateVlanTarget(network LanNetwork) error
- type APLANPortSettings
- type APRadioSettings
- func (s APRadioSettings) AutoChannel() bool
- func (s APRadioSettings) ChannelIndex() int
- func (s APRadioSettings) ChannelWidth() ChannelWidth
- func (s APRadioSettings) Frequency() int
- func (s APRadioSettings) RadioEnabled() bool
- func (s APRadioSettings) Raw() map[string]any
- func (s APRadioSettings) TxPower() int
- func (s APRadioSettings) TxPowerLevel() int
- func (s APRadioSettings) WirelessMode() int
- type APRadioStatus
- func (s APRadioStatus) ActualChannel() string
- func (s APRadioStatus) BandWidth() string
- func (s APRadioStatus) InterUtil() int
- func (s APRadioStatus) MaxTxRate() int
- func (s APRadioStatus) RXUtil() int
- func (s APRadioStatus) TXUtil() int
- func (s APRadioStatus) TxPower() int
- func (s APRadioStatus) WirelessMode() string
- type AccessPoint
- func (a AccessPoint) LANPortSettings() []APLANPortSettings
- func (a AccessPoint) RadioBands() []RadioId
- func (a AccessPoint) RadioSettings(band RadioId) *APRadioSettings
- func (a AccessPoint) RadioStatus(band RadioId) *APRadioStatus
- func (a AccessPoint) Supports5G() bool
- func (a AccessPoint) Supports5G2() bool
- func (a AccessPoint) Supports6G() bool
- func (a AccessPoint) Supports11AC() bool
- func (a AccessPoint) SupportsMesh() bool
- func (a AccessPoint) WiredUplink() *Link
- func (a AccessPoint) WirelessLinked() bool
- type AuthenticationStatus
- type BandwidthControl
- type ChannelWidth
- type Client
- func (c Client) Activity() int
- func (c Client) AuthStatus() AuthenticationStatus
- func (c Client) ConnectDevType() *string
- func (c Client) ConnectType() ConnectType
- func (c Client) ConnectionTime() *int
- func (c Client) DeviceCategory() *string
- func (c Client) DeviceType() string
- func (c Client) DownPacket() int
- func (c Client) HostName() *string
- func (c Client) IP() *string
- func (c Client) IPSetting() IpSetting
- func (c Client) IsActive() bool
- func (c Client) IsBlocked() bool
- func (c Client) IsGuest() bool
- func (c Client) IsWireless() *bool
- func (c Client) LastSeen() float64
- func (c Client) MAC() string
- func (c Client) Name() string
- func (c Client) OSName() *string
- func (c Client) RateLimit() RateLimit
- func (c Client) TrafficDown() int
- func (c Client) TrafficUp() int
- func (c Client) UpPacket() int
- func (c Client) VLAN() *int
- func (c Client) Vendor() *string
- type ConnectType
- type ControllerInfo
- func (c ControllerInfo) APIVersion() string
- func (c ControllerInfo) Category() string
- func (c ControllerInfo) CloudURL() string
- func (c ControllerInfo) Configured() *bool
- func (c ControllerInfo) ControllerVersion() string
- func (c ControllerInfo) ID() string
- func (c ControllerInfo) MspMode() *bool
- func (c ControllerInfo) Raw() map[string]any
- func (c ControllerInfo) RegisteredRoot() *bool
- func (c ControllerInfo) SupportApp() *bool
- func (c ControllerInfo) Type() *int
- type ControllerStatus
- type ControllerTypeModel
- type ControllerUpdateInfo
- func (c ControllerUpdateInfo) CurrentVersion() *string
- func (c ControllerUpdateInfo) Hardware() *HardwareUpdateInfo
- func (c ControllerUpdateInfo) LatestVersion() *string
- func (c ControllerUpdateInfo) Raw() map[string]any
- func (c ControllerUpdateInfo) ReleaseNotes() *string
- func (c ControllerUpdateInfo) ReleaseURL() *string
- func (c ControllerUpdateInfo) Software() *SoftwareUpdateInfo
- func (c ControllerUpdateInfo) Update() *updateInfoSection
- func (c ControllerUpdateInfo) Upgrade() bool
- type Device
- func (d Device) CPUUsage() int
- func (d Device) DisplayUptime() *string
- func (d Device) FWDownload() bool
- func (d Device) FirmwareVersion() string
- func (d Device) IPAddress() string
- func (d Device) LedSetting() LedSetting
- func (d Device) MAC() string
- func (d Device) MemUsage() int
- func (d Device) Model() string
- func (d Device) ModelDisplayName() string
- func (d Device) Name() string
- func (d Device) NeedUpgrade() bool
- func (d Device) ResourcePath() string
- func (d Device) Status() DeviceStatus
- func (d Device) StatusCategory() DeviceStatusCategory
- func (d Device) Type() string
- func (d Device) Uptime() int
- type DeviceStatus
- type DeviceStatusCategory
- type DhcpReservation
- func (d DhcpReservation) ClientName() *string
- func (d DhcpReservation) Description() *string
- func (d DhcpReservation) ExportToIpMacBinding() *bool
- func (d DhcpReservation) ID() string
- func (d DhcpReservation) IP() string
- func (d DhcpReservation) MAC() string
- func (d DhcpReservation) NetID() *string
- func (d DhcpReservation) NetName() *string
- func (d DhcpReservation) Status() *bool
- type Downlink
- type Eth802Dot1X
- type FirmwareUpdate
- type Gateway
- func (g Gateway) EchoServer() *string
- func (g Gateway) IP() string
- func (g Gateway) IsCombinedGateway() bool
- func (g Gateway) LLDPEnabled() bool
- func (g Gateway) NumberPorts() int
- func (g Gateway) PortConfigs() []GatewayPortConfig
- func (g Gateway) PortStatuses() []GatewayPortStatus
- func (g Gateway) SupportsPoE() bool
- type GatewayPortConfig
- type GatewayPortMode
- type GatewayPortStatus
- func (p GatewayPortStatus) BytesRX() int
- func (p GatewayPortStatus) BytesTX() int
- func (p GatewayPortStatus) DisplayName() string
- func (p GatewayPortStatus) IPv6WANConnected() bool
- func (p GatewayPortStatus) LinkDuplex() LinkDuplex
- func (p GatewayPortStatus) LinkSpeed() LinkSpeed
- func (p GatewayPortStatus) LinkStatus() LinkStatus
- func (p GatewayPortStatus) Mode() GatewayPortMode
- func (p GatewayPortStatus) Name() string
- func (p GatewayPortStatus) OnlineDetection() bool
- func (p GatewayPortStatus) PoEActive() bool
- func (p GatewayPortStatus) PortNumber() int
- func (p GatewayPortStatus) Type() GatewayPortType
- func (p GatewayPortStatus) WANConnected() bool
- func (p GatewayPortStatus) WANIPAddress() *string
- func (p GatewayPortStatus) WANIPv6Address() *string
- func (p GatewayPortStatus) WANIPv6Enabled() bool
- func (p GatewayPortStatus) WANProtocol() *string
- type GatewayPortType
- type HardwareUpdateInfo
- func (u HardwareUpdateInfo) CurrentVersion() *string
- func (u HardwareUpdateInfo) DownloadLink() *string
- func (u HardwareUpdateInfo) LatestVersion() *string
- func (u HardwareUpdateInfo) Raw() map[string]any
- func (u HardwareUpdateInfo) ReleaseNotes() *string
- func (u HardwareUpdateInfo) ReleaseURL() *string
- func (u HardwareUpdateInfo) Upgrade() bool
- type HardwareUpgradeStatus
- func (c HardwareUpgradeStatus) DownloadProgress() int
- func (c HardwareUpgradeStatus) Raw() map[string]any
- func (c HardwareUpgradeStatus) RebootTime() int
- func (c HardwareUpgradeStatus) UpgradeMsg() string
- func (c HardwareUpgradeStatus) UpgradeStatus() int
- func (c HardwareUpgradeStatus) UpgradeTime() int
- type InterfaceDetails
- type IpSetting
- type LanNetwork
- type LedSetting
- type Link
- type LinkDuplex
- type LinkSpeed
- type LinkStatus
- type NetworkTagsSetting
- type PoEMode
- type PortDetails
- func (p PortDetails) BandwidthLimitMode() BandwidthControl
- func (p PortDetails) Duplex() LinkDuplex
- func (p PortDetails) EEEEnabled() bool
- func (p PortDetails) Eth8021xControl() Eth802Dot1X
- func (p PortDetails) FlowControlEnabled() bool
- func (p PortDetails) HasEEE() bool
- func (p PortDetails) HasFlowControl() bool
- func (p PortDetails) HasLoopbackDetectVlanBased() bool
- func (p PortDetails) HasProfileOverride() bool
- func (p PortDetails) HasVoiceNetwork() bool
- func (p PortDetails) LLDPMedEnabled() bool
- func (p PortDetails) LinkSpeed() LinkSpeed
- func (p PortDetails) LoopbackDetectEnabled() bool
- func (p PortDetails) LoopbackDetectVlanBasedEnabled() bool
- func (p PortDetails) MaxSpeed() LinkSpeed
- func (p PortDetails) NativeNetworkID() *string
- func (p PortDetails) NetworkTagsSetting() NetworkTagsSetting
- func (p PortDetails) PoEMode() PoEMode
- func (p PortDetails) PortID() string
- func (p PortDetails) PortIsolationEnabled() bool
- func (p PortDetails) ProfileName() string
- func (p PortDetails) SpanningTreeEnabled() bool
- func (p PortDetails) SupportsPoE() bool
- func (p PortDetails) TagIDs() []string
- func (p PortDetails) TaggedNetworkIDs() []string
- func (p PortDetails) TopologyNotifyEnabled() bool
- func (p PortDetails) UntaggedNetworkIDs() []string
- func (p PortDetails) VoiceNetworkEnabled() bool
- func (p PortDetails) VoiceNetworkID() *string
- type PortProfile
- func (p PortProfile) BandwidthLimitMode() BandwidthControl
- func (p PortProfile) EEEEnabled() bool
- func (p PortProfile) Eth8021xControl() Eth802Dot1X
- func (p PortProfile) FlowControlEnabled() bool
- func (p PortProfile) HasEEE() bool
- func (p PortProfile) HasFlowControl() bool
- func (p PortProfile) HasLoopbackDetectVlanBased() bool
- func (p PortProfile) LLDPMedEnabled() bool
- func (p PortProfile) LoopbackDetectEnabled() bool
- func (p PortProfile) LoopbackDetectVlanBasedEnabled() bool
- func (p PortProfile) Name() string
- func (p PortProfile) PoEMode() PoEMode
- func (p PortProfile) PortIsolationEnabled() bool
- func (p PortProfile) ProfileID() string
- func (p PortProfile) Site() string
- func (p PortProfile) SpanningTreeEnabled() bool
- func (p PortProfile) TopologyNotifyEnabled() bool
- type PortType
- type RadioId
- type RateLimit
- type RequestError
- type Site
- type SoftwareUpdateInfo
- func (u SoftwareUpdateInfo) CurrentVersion() *string
- func (u SoftwareUpdateInfo) DownloadLink() *string
- func (u SoftwareUpdateInfo) LatestVersion() *string
- func (u SoftwareUpdateInfo) Raw() map[string]any
- func (u SoftwareUpdateInfo) ReleaseNotes() *string
- func (u SoftwareUpdateInfo) ReleaseURL() *string
- func (u SoftwareUpdateInfo) Upgrade() bool
- type Switch
- type SwitchDeviceCaps
- type SwitchPort
- type SwitchPortStatus
- func (s SwitchPortStatus) BytesRX() int
- func (s SwitchPortStatus) BytesTX() int
- func (s SwitchPortStatus) LinkSpeed() LinkSpeed
- func (s SwitchPortStatus) LinkStatus() LinkStatus
- func (s SwitchPortStatus) PoEActive() bool
- func (s SwitchPortStatus) PoEPower() *float64
- func (s SwitchPortStatus) STPDiscarding() bool
- type Topology
- type TopologyNode
- func (n TopologyNode) ClientCount() int
- func (n TopologyNode) Disconnected() bool
- func (n TopologyNode) IPAddress() *string
- func (n TopologyNode) MAC() string
- func (n TopologyNode) Model() *string
- func (n TopologyNode) Name() string
- func (n TopologyNode) OwnUplinkPort() *string
- func (n TopologyNode) Status() DeviceStatus
- func (n TopologyNode) StatusCategory() DeviceStatusCategory
- func (n TopologyNode) Successors() []TopologyNode
- func (n TopologyNode) Type() string
- func (n TopologyNode) UpstreamDuplex() LinkDuplex
- func (n TopologyNode) UpstreamLinkSpeed() LinkSpeed
- func (n TopologyNode) UpstreamPort() *string
- func (n TopologyNode) WANPorts() []TopologyWanPort
- type TopologyWanPort
- func (w TopologyWanPort) Duplex() LinkDuplex
- func (w TopologyWanPort) LinkSpeed() LinkSpeed
- func (w TopologyWanPort) LinkStatus() LinkStatus
- func (w TopologyWanPort) Name() string
- func (w TopologyWanPort) OnlineDetection() bool
- func (w TopologyWanPort) Port() string
- func (w TopologyWanPort) WANConnected() bool
- type UpdateSection
- type ValidationError
- type Version
- type VlanCreate
- type VlanUpdate
- type VpnCategory
- type VpnPolicy
- type VpnType
- type WifiMode
- type WiredDetails
- type WirelessDetails
- func (w WirelessDetails) APMAC() string
- func (w WirelessDetails) APName() string
- func (w WirelessDetails) Channel() int
- func (w WirelessDetails) PowerSave() bool
- func (w WirelessDetails) RSSI() int
- func (w WirelessDetails) RadioID() RadioId
- func (w WirelessDetails) RxRate() int
- func (w WirelessDetails) SSID() string
- func (w WirelessDetails) SignalLevel() int
- func (w WirelessDetails) SignalRank() int
- func (w WirelessDetails) TxRate() int
- func (w WirelessDetails) WifiMode() WifiMode
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLoginFailed is returned when the controller rejects the credentials // or reports a missing/expired session (controller code -30109). ErrLoginFailed = &RequestError{Code: -30109} // ErrLoginSessionClosed is returned when the session cookie is no longer // accepted, typically because the cookie jar dropped it. ErrLoginSessionClosed = errors.New("login session closed") // ErrUnsupportedControllerVersion is returned when the controller is older // than the minimum supported version. ErrUnsupportedControllerVersion = errors.New("unsupported Omada controller version") // ErrSiteNotFound is returned when a referenced site does not exist. ErrSiteNotFound = errors.New("site not found") // ErrConnectionFailed wraps network-level failures reaching the controller. ErrConnectionFailed = errors.New("connection to Omada controller failed") // ErrBadControllerURL wraps failures resolving the controller URL. ErrBadControllerURL = errors.New("controller URL could not be resolved") // ErrInvalidDevice is returned when a device lookup yields no usable device. ErrInvalidDevice = errors.New("invalid device") )
Functions ¶
func MapInt ¶
MapInt returns the numeric value at key as int, or 0 when absent. JSON numbers decode as float64; whole floats are converted safely.
func MapPtrBool ¶
MapPtrBool returns a pointer to the bool at key, or nil when absent.
func MapPtrFloat ¶
MapPtrFloat returns a pointer to the numeric value at key, or nil when absent.
func MapStrList ¶
MapStrList returns the list of strings at key, or nil when absent.
func ValidateVlanConflicts ¶
func ValidateVlanConflicts(payload map[string]any, networks []LanNetwork, excludeID *string) error
ValidateVlanConflicts rejects collisions against a fresh inventory, including routed networks.
func ValidateVlanTarget ¶
func ValidateVlanTarget(network LanNetwork) error
ValidateVlanTarget rejects protected, routed, incomplete, or unverified VLAN targets.
Types ¶
type APLANPortSettings ¶
type APLANPortSettings struct {
// contains filtered or unexported fields
}
APLANPortSettings is a LAN port on an access point.
func NewAPLANPortSettings ¶
func NewAPLANPortSettings(data map[string]any) APLANPortSettings
NewAPLANPortSettings builds an APLANPortSettings from a raw API object.
func (APLANPortSettings) LocalVLANEnable ¶
func (p APLANPortSettings) LocalVLANEnable() bool
LocalVLANEnable reports whether VLAN tagging is enabled for the port.
func (APLANPortSettings) LocalVLANID ¶
func (p APLANPortSettings) LocalVLANID() int
LocalVLANID is the VLAN ID of the port.
func (APLANPortSettings) PoEEnable ¶
func (p APLANPortSettings) PoEEnable() bool
PoEEnable is the PoE state of the port.
func (APLANPortSettings) PortName ¶
func (p APLANPortSettings) PortName() string
PortName is the port name (not editable).
func (APLANPortSettings) SupportsPoE ¶
func (p APLANPortSettings) SupportsPoE() bool
SupportsPoE reports whether the port supports PoE output.
func (APLANPortSettings) SupportsVLAN ¶
func (p APLANPortSettings) SupportsVLAN() bool
SupportsVLAN reports whether the port supports VLAN tagging.
type APRadioSettings ¶
type APRadioSettings struct {
// contains filtered or unexported fields
}
APRadioSettings is the configured state of one radio on an access point.
func NewAPRadioSettings ¶
func NewAPRadioSettings(data map[string]any) APRadioSettings
NewAPRadioSettings builds an APRadioSettings from a raw API object.
func (APRadioSettings) AutoChannel ¶
func (s APRadioSettings) AutoChannel() bool
AutoChannel reports whether the AP chooses the channel itself.
func (APRadioSettings) ChannelIndex ¶
func (s APRadioSettings) ChannelIndex() int
ChannelIndex is the configured channel as a 1-based index into the radio's channel list. 0 means the AP picks the channel automatically.
func (APRadioSettings) ChannelWidth ¶
func (s APRadioSettings) ChannelWidth() ChannelWidth
ChannelWidth is the configured channel width.
func (APRadioSettings) Frequency ¶
func (s APRadioSettings) Frequency() int
Frequency is the centre frequency of the configured channel in MHz.
func (APRadioSettings) RadioEnabled ¶
func (s APRadioSettings) RadioEnabled() bool
RadioEnabled reports whether the radio is switched on.
func (APRadioSettings) Raw ¶
func (s APRadioSettings) Raw() map[string]any
Raw is the underlying API object.
func (APRadioSettings) TxPower ¶
func (s APRadioSettings) TxPower() int
TxPower is the transmit power in dBm.
func (APRadioSettings) TxPowerLevel ¶
func (s APRadioSettings) TxPowerLevel() int
TxPowerLevel is the transmit power preset (0=Low, 1=Medium, 2=High, 3=Custom, 4=Auto).
func (APRadioSettings) WirelessMode ¶
func (s APRadioSettings) WirelessMode() int
WirelessMode is the 802.11 mode of the radio. -2 means automatic.
type APRadioStatus ¶
type APRadioStatus struct {
// contains filtered or unexported fields
}
APRadioStatus is the live state of one radio on an access point.
func NewAPRadioStatus ¶
func NewAPRadioStatus(data map[string]any) APRadioStatus
NewAPRadioStatus builds an APRadioStatus from a raw API object.
func (APRadioStatus) ActualChannel ¶
func (s APRadioStatus) ActualChannel() string
ActualChannel is the channel currently in use, e.g. "36 / 5180MHz".
func (APRadioStatus) BandWidth ¶
func (s APRadioStatus) BandWidth() string
BandWidth is the channel width currently in use, e.g. "40MHz".
func (APRadioStatus) InterUtil ¶
func (s APRadioStatus) InterUtil() int
InterUtil is the percentage of airtime lost to interference.
func (APRadioStatus) MaxTxRate ¶
func (s APRadioStatus) MaxTxRate() int
MaxTxRate is the maximum PHY rate at the current width in Mbps.
func (APRadioStatus) RXUtil ¶
func (s APRadioStatus) RXUtil() int
RXUtil is the percentage of airtime spent receiving.
func (APRadioStatus) TXUtil ¶
func (s APRadioStatus) TXUtil() int
TXUtil is the percentage of airtime spent transmitting.
func (APRadioStatus) TxPower ¶
func (s APRadioStatus) TxPower() int
TxPower is the transmit power currently in use in dBm.
func (APRadioStatus) WirelessMode ¶
func (s APRadioStatus) WirelessMode() string
WirelessMode is the 802.11 mode in use, e.g. "a/n/ac mixed".
type AccessPoint ¶
type AccessPoint struct {
Device
}
AccessPoint is the details of a managed access point.
func NewAccessPoint ¶
func NewAccessPoint(data map[string]any) AccessPoint
NewAccessPoint builds an AccessPoint from a raw API object.
func (AccessPoint) LANPortSettings ¶
func (a AccessPoint) LANPortSettings() []APLANPortSettings
LANPortSettings are the settings for the AP's LAN ports.
func (AccessPoint) RadioBands ¶
func (a AccessPoint) RadioBands() []RadioId
RadioBands are the radios this AP actually has.
func (AccessPoint) RadioSettings ¶
func (a AccessPoint) RadioSettings(band RadioId) *APRadioSettings
RadioSettings returns the configured state of one radio, or nil if the AP has no such radio.
func (AccessPoint) RadioStatus ¶
func (a AccessPoint) RadioStatus(band RadioId) *APRadioStatus
RadioStatus returns the live state of one radio, or nil if the AP has no such radio.
func (AccessPoint) Supports5G ¶
func (a AccessPoint) Supports5G() bool
Supports5G reports whether 5 GHz wifi is supported.
func (AccessPoint) Supports5G2 ¶
func (a AccessPoint) Supports5G2() bool
Supports5G2 reports whether 5G2 wifi is supported.
func (AccessPoint) Supports6G ¶
func (a AccessPoint) Supports6G() bool
Supports6G reports whether Wi-Fi 6 is supported.
func (AccessPoint) Supports11AC ¶
func (a AccessPoint) Supports11AC() bool
Supports11AC reports whether 802.11ac is supported.
func (AccessPoint) SupportsMesh ¶
func (a AccessPoint) SupportsMesh() bool
SupportsMesh reports whether mesh networking is supported.
func (AccessPoint) WiredUplink ¶
func (a AccessPoint) WiredUplink() *Link
WiredUplink is the AP's wired uplink device, nil when absent.
func (AccessPoint) WirelessLinked ¶
func (a AccessPoint) WirelessLinked() bool
WirelessLinked reports whether the AP is connected wirelessly.
type AuthenticationStatus ¶
type AuthenticationStatus int32
const ( AuthenticationStatusUnknown AuthenticationStatus = -1 AuthenticationStatusConnected AuthenticationStatus = 0 AuthenticationStatusPending AuthenticationStatus = 1 AuthenticationStatusAuthorized AuthenticationStatus = 2 AuthenticationStatusAuthFree AuthenticationStatus = 3 )
func (AuthenticationStatus) String ¶
func (s AuthenticationStatus) String() string
type BandwidthControl ¶
type BandwidthControl int32
const ( BandwidthControlUnknown BandwidthControl = -1 BandwidthControlOff BandwidthControl = 0 BandwidthControlRateLimit BandwidthControl = 1 BandwidthControlStormControl BandwidthControl = 2 )
func (BandwidthControl) String ¶
func (s BandwidthControl) String() string
type ChannelWidth ¶
type ChannelWidth int32
const ( ChannelWidthUnknown ChannelWidth = -1 ChannelWidthWidth20 ChannelWidth = 2 ChannelWidthWidth40 ChannelWidth = 3 ChannelWidthAuto4020 ChannelWidth = 4 ChannelWidthWidth80 ChannelWidth = 5 ChannelWidthAuto804020 ChannelWidth = 6 ChannelWidthWidth160 ChannelWidth = 7 ChannelWidthAuto160804020 ChannelWidth = 8 ChannelWidthWidth240 ChannelWidth = 9 ChannelWidthWidth320 ChannelWidth = 10 )
func (ChannelWidth) String ¶
func (s ChannelWidth) String() string
type Client ¶
type Client struct {
// Wired holds switch/gateway port details. Populated for wired clients.
Wired *WiredDetails
// Wireless holds AP radio details. Populated for wireless clients.
Wireless *WirelessDetails
// contains filtered or unexported fields
}
Client is a device connected to the Omada network.
func (Client) AuthStatus ¶
func (c Client) AuthStatus() AuthenticationStatus
AuthStatus is the authentication status.
func (Client) ConnectDevType ¶
ConnectDevType is the type of device the client is connected to.
func (Client) ConnectType ¶
func (c Client) ConnectType() ConnectType
ConnectType is the connection type.
func (Client) ConnectionTime ¶
ConnectionTime is the client connection time in seconds.
func (Client) DeviceCategory ¶
DeviceCategory is the device category.
func (Client) DeviceType ¶
DeviceType is the client device type (Android, iPhone, ...).
func (Client) DownPacket ¶
DownPacket is the number of packets sent to the client.
func (Client) IsBlocked ¶
IsBlocked reports whether the client is blocked. Most API calls return "blocked"; the known_clients call returns "block".
func (Client) IsWireless ¶
IsWireless reports whether the client is wireless, nil when unreported.
func (Client) LastSeen ¶
LastSeen is the Unix timestamp (seconds) when the client was last connected.
func (Client) TrafficDown ¶
TrafficDown is the number of bytes sent to the client.
type ConnectType ¶
type ConnectType int32
const ( ConnectTypeUnknown ConnectType = -1 ConnectTypeGuestWireless ConnectType = 0 ConnectTypeWireless ConnectType = 1 ConnectTypeWired ConnectType = 2 )
func (ConnectType) String ¶
func (s ConnectType) String() string
type ControllerInfo ¶
type ControllerInfo struct {
// contains filtered or unexported fields
}
ControllerInfo wraps the /api/info response.
func NewControllerInfo ¶
func NewControllerInfo(m map[string]any) ControllerInfo
func (ControllerInfo) APIVersion ¶
func (c ControllerInfo) APIVersion() string
APIVersion is the controller API version, when reported.
func (ControllerInfo) Category ¶
func (c ControllerInfo) Category() string
Category is the controller category, when reported.
func (ControllerInfo) CloudURL ¶
func (c ControllerInfo) CloudURL() string
CloudURL is the Omada cloud URL, when reported.
func (ControllerInfo) Configured ¶
func (c ControllerInfo) Configured() *bool
Configured reports whether the setup wizard has been completed.
func (ControllerInfo) ControllerVersion ¶
func (c ControllerInfo) ControllerVersion() string
ControllerVersion is the controller software version.
func (ControllerInfo) ID ¶
func (c ControllerInfo) ID() string
ID is the controller's unique ID (omadacId).
func (ControllerInfo) MspMode ¶
func (c ControllerInfo) MspMode() *bool
MspMode reports whether the controller runs in MSP mode.
func (ControllerInfo) Raw ¶
func (c ControllerInfo) Raw() map[string]any
Raw returns the original response map.
func (ControllerInfo) RegisteredRoot ¶
func (c ControllerInfo) RegisteredRoot() *bool
RegisteredRoot reports whether the root account is registered.
func (ControllerInfo) SupportApp ¶
func (c ControllerInfo) SupportApp() *bool
SupportApp reports whether the Omada app is supported.
func (ControllerInfo) Type ¶
func (c ControllerInfo) Type() *int
Type is the controller type code as returned by the API.
type ControllerStatus ¶
type ControllerStatus struct {
// contains filtered or unexported fields
}
ControllerStatus wraps the maintenance/controllerStatus response.
func NewControllerStatus ¶
func NewControllerStatus(m map[string]any) ControllerStatus
func (ControllerStatus) ControllerVersion ¶
func (c ControllerStatus) ControllerVersion() string
ControllerVersion is the version reported by the status endpoint.
func (ControllerStatus) MAC ¶
func (c ControllerStatus) MAC() string
MAC is the controller MAC address.
func (ControllerStatus) Model ¶
func (c ControllerStatus) Model() string
Model is the hardware model, falling back to "Controller".
func (ControllerStatus) Name ¶
func (c ControllerStatus) Name() *string
Name is the controller display name, stripped; nil when absent.
func (ControllerStatus) Raw ¶
func (c ControllerStatus) Raw() map[string]any
func (ControllerStatus) Uptime ¶
func (c ControllerStatus) Uptime() int64
Uptime is the controller uptime in seconds.
type ControllerTypeModel ¶
type ControllerTypeModel struct {
// contains filtered or unexported fields
}
ControllerTypeModel wraps the anon/controllerType response.
func NewControllerTypeModel ¶
func NewControllerTypeModel(m map[string]any) ControllerTypeModel
func (ControllerTypeModel) CombinedGateway ¶
func (c ControllerTypeModel) CombinedGateway() bool
CombinedGateway reports whether the controller runs on a combined gateway.
func (ControllerTypeModel) IsSoftController ¶
func (c ControllerTypeModel) IsSoftController() bool
IsSoftController reports whether this is an Omada Software Controller.
func (ControllerTypeModel) Raw ¶
func (c ControllerTypeModel) Raw() map[string]any
type ControllerUpdateInfo ¶
type ControllerUpdateInfo struct {
// contains filtered or unexported fields
}
ControllerUpdateInfo wraps a normalized controller update report.
func NewControllerUpdateInfo ¶
func NewControllerUpdateInfo(m map[string]any) ControllerUpdateInfo
func (ControllerUpdateInfo) CurrentVersion ¶
func (c ControllerUpdateInfo) CurrentVersion() *string
CurrentVersion is the current version of the relevant update section.
func (ControllerUpdateInfo) Hardware ¶
func (c ControllerUpdateInfo) Hardware() *HardwareUpdateInfo
Hardware is the hardware (firmware) update section, when present.
func (ControllerUpdateInfo) LatestVersion ¶
func (c ControllerUpdateInfo) LatestVersion() *string
LatestVersion is the latest version of the relevant update section.
func (ControllerUpdateInfo) Raw ¶
func (c ControllerUpdateInfo) Raw() map[string]any
func (ControllerUpdateInfo) ReleaseNotes ¶
func (c ControllerUpdateInfo) ReleaseNotes() *string
ReleaseNotes are the notes of the relevant update section.
func (ControllerUpdateInfo) ReleaseURL ¶
func (c ControllerUpdateInfo) ReleaseURL() *string
ReleaseURL is the release URL of the relevant update section.
func (ControllerUpdateInfo) Software ¶
func (c ControllerUpdateInfo) Software() *SoftwareUpdateInfo
Software is the software update section, when present.
func (ControllerUpdateInfo) Update ¶
func (c ControllerUpdateInfo) Update() *updateInfoSection
Update is the section matching the current controller type (hardware first).
func (ControllerUpdateInfo) Upgrade ¶
func (c ControllerUpdateInfo) Upgrade() bool
Upgrade reports whether any update is available.
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is a managed Omada device (gateway, switch, access point).
func (Device) DisplayUptime ¶
DisplayUptime is the uptime as a display string, nil when not connected.
func (Device) FWDownload ¶
FWDownload reports whether a firmware upgrade is being downloaded.
func (Device) FirmwareVersion ¶
FirmwareVersion is the running firmware version.
func (Device) LedSetting ¶
func (d Device) LedSetting() LedSetting
LedSetting is the onboard LED setting.
func (Device) ModelDisplayName ¶
ModelDisplayName is the model description for front-end display.
func (Device) NeedUpgrade ¶
NeedUpgrade reports whether a firmware upgrade is available.
func (Device) ResourcePath ¶
ResourcePath is the API path for querying detailed data about this device.
func (Device) StatusCategory ¶
func (d Device) StatusCategory() DeviceStatusCategory
StatusCategory is the high-level device status.
type DeviceStatus ¶
type DeviceStatus int32
const ( DeviceStatusUnknown DeviceStatus = -1 DeviceStatusDisconnected DeviceStatus = 0 DeviceStatusDisconnectedMigrating DeviceStatus = 1 DeviceStatusProvisioning DeviceStatus = 10 DeviceStatusConfiguring DeviceStatus = 11 DeviceStatusUpgrading DeviceStatus = 12 DeviceStatusRebooting DeviceStatus = 13 DeviceStatusConnected DeviceStatus = 14 DeviceStatusConnectedWireless DeviceStatus = 15 DeviceStatusConnectedMigrating DeviceStatus = 16 DeviceStatusConnectedWirelessMigrating DeviceStatus = 17 DeviceStatusPending DeviceStatus = 20 DeviceStatusPendingWireless DeviceStatus = 21 DeviceStatusAdopting DeviceStatus = 22 DeviceStatusAdoptingWireless DeviceStatus = 23 DeviceStatusAdoptFailed DeviceStatus = 24 DeviceStatusAdoptFailedWireless DeviceStatus = 25 DeviceStatusManagedExternally DeviceStatus = 26 DeviceStatusManagedExternallyWireless DeviceStatus = 27 DeviceStatusHeartbeatMissed DeviceStatus = 30 DeviceStatusHeartbeatMissedWireless DeviceStatus = 31 DeviceStatusHeartbeatMissedMigrating DeviceStatus = 32 DeviceStatusHeartbeatMissedWirelessMigrat DeviceStatus = 33 DeviceStatusIsolated DeviceStatus = 40 DeviceStatusIsolatedMigrating DeviceStatus = 41 )
func (DeviceStatus) String ¶
func (s DeviceStatus) String() string
type DeviceStatusCategory ¶
type DeviceStatusCategory int32
const ( DeviceStatusCategoryUnknown DeviceStatusCategory = -1 DeviceStatusCategoryDisconnected DeviceStatusCategory = 0 DeviceStatusCategoryConnected DeviceStatusCategory = 1 DeviceStatusCategoryPending DeviceStatusCategory = 2 DeviceStatusCategoryHeartbeatMissed DeviceStatusCategory = 3 DeviceStatusCategoryIsolated DeviceStatusCategory = 4 )
func (DeviceStatusCategory) String ¶
func (s DeviceStatusCategory) String() string
type DhcpReservation ¶
type DhcpReservation struct {
// contains filtered or unexported fields
}
DhcpReservation is a DHCP reservation on an Omada controller.
func NewDhcpReservation ¶
func NewDhcpReservation(data map[string]any) DhcpReservation
NewDhcpReservation builds a DhcpReservation from a raw API object.
func (DhcpReservation) ClientName ¶
func (d DhcpReservation) ClientName() *string
ClientName is the name of the client associated with this reservation.
func (DhcpReservation) Description ¶
func (d DhcpReservation) Description() *string
Description is the description/name for the reservation.
func (DhcpReservation) ExportToIpMacBinding ¶
func (d DhcpReservation) ExportToIpMacBinding() *bool
ExportToIpMacBinding reports whether the reservation is exported to IP-MAC binding.
func (DhcpReservation) NetID ¶
func (d DhcpReservation) NetID() *string
NetID is the ID of the network this reservation belongs to.
func (DhcpReservation) NetName ¶
func (d DhcpReservation) NetName() *string
NetName is the name of the network this reservation belongs to.
func (DhcpReservation) Status ¶
func (d DhcpReservation) Status() *bool
Status reports whether the reservation is active.
type Downlink ¶
type Downlink struct {
// contains filtered or unexported fields
}
Downlink is a downlink device attached to a switch port.
func NewDownlink ¶
NewDownlink builds a Downlink from a raw API object.
type Eth802Dot1X ¶
type Eth802Dot1X int32
const ( Eth802Dot1XUnknown Eth802Dot1X = -1 Eth802Dot1XForceAuthorized Eth802Dot1X = 1 Eth802Dot1XAuto Eth802Dot1X = 2 )
func (Eth802Dot1X) String ¶
func (s Eth802Dot1X) String() string
type FirmwareUpdate ¶
type FirmwareUpdate struct {
// contains filtered or unexported fields
}
FirmwareUpdate wraps a device firmware update entry.
func NewFirmwareUpdate ¶
func NewFirmwareUpdate(m map[string]any) FirmwareUpdate
func (FirmwareUpdate) CurrentVersion ¶
func (c FirmwareUpdate) CurrentVersion() string
CurrentVersion is the device's current firmware version.
func (FirmwareUpdate) LatestVersion ¶
func (c FirmwareUpdate) LatestVersion() string
LatestVersion is the latest available firmware version.
func (FirmwareUpdate) Raw ¶
func (c FirmwareUpdate) Raw() map[string]any
func (FirmwareUpdate) ReleaseNotes ¶
func (c FirmwareUpdate) ReleaseNotes() string
ReleaseNotes are the release notes for the new firmware.
type Gateway ¶
type Gateway struct {
Device
}
Gateway is the details of a managed gateway.
func NewGateway ¶
NewGateway builds a Gateway from a raw API object.
func (Gateway) EchoServer ¶
EchoServer is the address of the server pinged for online detection.
func (Gateway) IsCombinedGateway ¶
IsCombinedGateway reports whether this is a combined gateway/switch.
func (Gateway) LLDPEnabled ¶
LLDPEnabled reports whether LLDP is enabled on the gateway.
func (Gateway) NumberPorts ¶
NumberPorts is the number of ports on the gateway.
func (Gateway) PortConfigs ¶
func (g Gateway) PortConfigs() []GatewayPortConfig
PortConfigs are the configurations of the gateway's ports, each including its status.
func (Gateway) PortStatuses ¶
func (g Gateway) PortStatuses() []GatewayPortStatus
PortStatuses are the live statuses of the gateway's ports.
func (Gateway) SupportsPoE ¶
SupportsPoE reports whether the device supports PoE.
type GatewayPortConfig ¶
type GatewayPortConfig struct {
// contains filtered or unexported fields
}
GatewayPortConfig is the configuration of a gateway port, including its status.
func NewGatewayPortConfig ¶
func NewGatewayPortConfig(data map[string]any, poeEnabled *bool) GatewayPortConfig
NewGatewayPortConfig builds a GatewayPortConfig from a raw API object. poeEnabled is the resolved PoE state for the port's number (nil when the gateway has no PoE settings for it).
func (GatewayPortConfig) Duplex ¶
func (p GatewayPortConfig) Duplex() LinkDuplex
Duplex is the configured duplex mode of the port.
func (GatewayPortConfig) LinkSpeed ¶
func (p GatewayPortConfig) LinkSpeed() LinkSpeed
LinkSpeed is the configured link speed of the port.
func (GatewayPortConfig) MirrorEnable ¶
func (p GatewayPortConfig) MirrorEnable() bool
MirrorEnable reports whether port mirroring is enabled.
func (GatewayPortConfig) PoEMode ¶
func (p GatewayPortConfig) PoEMode() PoEMode
PoEMode is the PoE mode of the port, resolved from the gateway's PoE settings.
func (GatewayPortConfig) PortNumber ¶
func (p GatewayPortConfig) PortNumber() int
PortNumber is the port number.
func (GatewayPortConfig) PortStatus ¶
func (p GatewayPortConfig) PortStatus() GatewayPortStatus
PortStatus is the full status of the port.
type GatewayPortMode ¶
type GatewayPortMode int32
const ( GatewayPortModeDisabled GatewayPortMode = -1 GatewayPortModeWAN GatewayPortMode = 0 GatewayPortModeLAN GatewayPortMode = 1 )
func (GatewayPortMode) String ¶
func (s GatewayPortMode) String() string
type GatewayPortStatus ¶
type GatewayPortStatus struct {
// contains filtered or unexported fields
}
GatewayPortStatus is the live status of a gateway port.
func NewGatewayPortStatus ¶
func NewGatewayPortStatus(data map[string]any) GatewayPortStatus
NewGatewayPortStatus builds a GatewayPortStatus from a raw API object.
func (GatewayPortStatus) BytesRX ¶
func (p GatewayPortStatus) BytesRX() int
BytesRX is the number of bytes received by the port.
func (GatewayPortStatus) BytesTX ¶
func (p GatewayPortStatus) BytesTX() int
BytesTX is the number of bytes transmitted by the port.
func (GatewayPortStatus) DisplayName ¶
func (p GatewayPortStatus) DisplayName() string
DisplayName is the port display name, falling back to Name.
func (GatewayPortStatus) IPv6WANConnected ¶
func (p GatewayPortStatus) IPv6WANConnected() bool
IPv6WANConnected reports whether the port is connected to the internet over IPv6.
func (GatewayPortStatus) LinkDuplex ¶
func (p GatewayPortStatus) LinkDuplex() LinkDuplex
LinkDuplex is the actual duplex mode of the port.
func (GatewayPortStatus) LinkSpeed ¶
func (p GatewayPortStatus) LinkSpeed() LinkSpeed
LinkSpeed is the established link speed of the port.
func (GatewayPortStatus) LinkStatus ¶
func (p GatewayPortStatus) LinkStatus() LinkStatus
LinkStatus is the low-level connectivity status of the link.
func (GatewayPortStatus) Mode ¶
func (p GatewayPortStatus) Mode() GatewayPortMode
Mode reports whether the port operates in WAN or LAN mode.
func (GatewayPortStatus) OnlineDetection ¶
func (p GatewayPortStatus) OnlineDetection() bool
OnlineDetection reports whether regular internet ping tests are working.
func (GatewayPortStatus) PoEActive ¶
func (p GatewayPortStatus) PoEActive() bool
PoEActive reports whether the port is powering a PoE device.
func (GatewayPortStatus) PortNumber ¶
func (p GatewayPortStatus) PortNumber() int
PortNumber is the port number.
func (GatewayPortStatus) Type ¶
func (p GatewayPortStatus) Type() GatewayPortType
Type is the port type: SFP, WAN, WAN/LAN, or LAN.
func (GatewayPortStatus) WANConnected ¶
func (p GatewayPortStatus) WANConnected() bool
WANConnected reports whether the port is connected to the internet.
func (GatewayPortStatus) WANIPAddress ¶
func (p GatewayPortStatus) WANIPAddress() *string
WANIPAddress is the WAN IPv4 address of the port.
func (GatewayPortStatus) WANIPv6Address ¶
func (p GatewayPortStatus) WANIPv6Address() *string
WANIPv6Address is the WAN IPv6 address of the port.
func (GatewayPortStatus) WANIPv6Enabled ¶
func (p GatewayPortStatus) WANIPv6Enabled() bool
WANIPv6Enabled reports whether the WAN IPv6 address is enabled.
func (GatewayPortStatus) WANProtocol ¶
func (p GatewayPortStatus) WANProtocol() *string
WANProtocol is the WAN protocol: static, dhcp, pppoe, l2tp, or pptp.
type GatewayPortType ¶
type GatewayPortType int32
const ( GatewayPortTypeUnknown GatewayPortType = -1 GatewayPortTypeWAN GatewayPortType = 0 GatewayPortTypeWANLAN GatewayPortType = 1 GatewayPortTypeLAN GatewayPortType = 2 GatewayPortTypeSFPWAN GatewayPortType = 3 )
func (GatewayPortType) String ¶
func (s GatewayPortType) String() string
type HardwareUpdateInfo ¶
type HardwareUpdateInfo struct {
// contains filtered or unexported fields
}
func NewHardwareUpdateInfo ¶
func NewHardwareUpdateInfo(m map[string]any) HardwareUpdateInfo
NewHardwareUpdateInfo wraps a controller hardware update section.
func (HardwareUpdateInfo) CurrentVersion ¶
func (u HardwareUpdateInfo) CurrentVersion() *string
CurrentVersion is the currently installed version, when reported.
func (HardwareUpdateInfo) DownloadLink ¶
func (u HardwareUpdateInfo) DownloadLink() *string
DownloadLink is the update download link, stripped; nil when absent.
func (HardwareUpdateInfo) LatestVersion ¶
func (u HardwareUpdateInfo) LatestVersion() *string
LatestVersion is the latest available version, falling back to the current one.
func (HardwareUpdateInfo) ReleaseNotes ¶
func (u HardwareUpdateInfo) ReleaseNotes() *string
ReleaseNotes is the release notes, checking both known keys.
func (HardwareUpdateInfo) ReleaseURL ¶
func (u HardwareUpdateInfo) ReleaseURL() *string
ReleaseURL is the release information URL, stripped; nil when absent.
type HardwareUpgradeStatus ¶
type HardwareUpgradeStatus struct {
// contains filtered or unexported fields
}
HardwareUpgradeStatus wraps the maintenance/hardware/upgradeStatus response.
func NewHardwareUpgradeStatus ¶
func NewHardwareUpgradeStatus(m map[string]any) HardwareUpgradeStatus
func (HardwareUpgradeStatus) DownloadProgress ¶
func (c HardwareUpgradeStatus) DownloadProgress() int
DownloadProgress is the firmware download progress percentage.
func (HardwareUpgradeStatus) Raw ¶
func (c HardwareUpgradeStatus) Raw() map[string]any
func (HardwareUpgradeStatus) RebootTime ¶
func (c HardwareUpgradeStatus) RebootTime() int
RebootTime is the expected seconds before the controller is back online.
func (HardwareUpgradeStatus) UpgradeMsg ¶
func (c HardwareUpgradeStatus) UpgradeMsg() string
UpgradeMsg is the message associated with the current status.
func (HardwareUpgradeStatus) UpgradeStatus ¶
func (c HardwareUpgradeStatus) UpgradeStatus() int
UpgradeStatus is the current status of the firmware upgrade process.
func (HardwareUpgradeStatus) UpgradeTime ¶
func (c HardwareUpgradeStatus) UpgradeTime() int
UpgradeTime is the suggested refresh interval for watching progress.
type InterfaceDetails ¶
type InterfaceDetails struct {
// contains filtered or unexported fields
}
InterfaceDetails wraps maintenance/uiInterface.
func NewInterfaceDetails ¶
func NewInterfaceDetails(m map[string]any) InterfaceDetails
func (InterfaceDetails) ControllerName ¶
func (c InterfaceDetails) ControllerName() string
ControllerName is the display name of the controller.
func (InterfaceDetails) Raw ¶
func (c InterfaceDetails) Raw() map[string]any
type IpSetting ¶
type IpSetting struct {
// contains filtered or unexported fields
}
IpSetting is the IP setting of a client.
func NewIpSetting ¶
NewIpSetting builds an IpSetting from a raw API object.
func (IpSetting) UsedFixedAddr ¶
UsedFixedAddr reports whether a fixed IP address is reserved.
type LanNetwork ¶
type LanNetwork struct {
// contains filtered or unexported fields
}
LanNetwork is a LAN network configuration.
func NewLanNetwork ¶
func NewLanNetwork(data map[string]any) LanNetwork
NewLanNetwork builds a LanNetwork from a raw API object.
func ResolveVlanTarget ¶
func ResolveVlanTarget(target string, networks []LanNetwork, byID bool) (LanNetwork, error)
ResolveVlanTarget resolves an exact ID/name, or strictly an ID after an earlier selection.
func (LanNetwork) DHCPEnabled ¶
func (n LanNetwork) DHCPEnabled() *bool
DHCPEnabled reports whether DHCP is enabled for the network, nil when not reported.
func (LanNetwork) GatewaySubnet ¶
func (n LanNetwork) GatewaySubnet() *string
GatewaySubnet is the gateway IPv4 subnet in CIDR notation.
func (LanNetwork) Purpose ¶
func (n LanNetwork) Purpose() string
Purpose is the controller network purpose.
func (LanNetwork) Raw ¶
func (n LanNetwork) Raw() map[string]any
Raw returns the raw API object backing this network.
func (LanNetwork) VLANID ¶
func (n LanNetwork) VLANID() *int
VLANID is the VLAN ID, when configured.
type LedSetting ¶
type LedSetting int32
const ( LedSettingUnknown LedSetting = -1 LedSettingOff LedSetting = 0 LedSettingOn LedSetting = 1 LedSettingSiteSettings LedSetting = 2 )
func (LedSetting) String ¶
func (s LedSetting) String() string
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
Link is an up/downlink connection from a switch or AP port.
type LinkDuplex ¶
type LinkDuplex int32
const ( LinkDuplexUnknown LinkDuplex = -1 LinkDuplexAuto LinkDuplex = 0 LinkDuplexHalf LinkDuplex = 1 LinkDuplexFull LinkDuplex = 2 )
func (LinkDuplex) String ¶
func (s LinkDuplex) String() string
type LinkStatus ¶
type LinkStatus int32
const ( LinkStatusUnknown LinkStatus = -1 LinkStatusLinkDown LinkStatus = 0 LinkStatusLinkUp LinkStatus = 1 )
func (LinkStatus) String ¶
func (s LinkStatus) String() string
type NetworkTagsSetting ¶
type NetworkTagsSetting int32
const ( NetworkTagsSettingUnknown NetworkTagsSetting = -1 NetworkTagsSettingAllowAll NetworkTagsSetting = 0 NetworkTagsSettingBlockAll NetworkTagsSetting = 1 NetworkTagsSettingCustom NetworkTagsSetting = 2 )
func (NetworkTagsSetting) String ¶
func (s NetworkTagsSetting) String() string
type PortDetails ¶
type PortDetails struct {
// contains filtered or unexported fields
}
PortDetails is the full configuration of a switch port.
func NewPortDetails ¶
func NewPortDetails(data map[string]any) PortDetails
NewPortDetails builds a PortDetails from a raw API object.
func (PortDetails) BandwidthLimitMode ¶
func (p PortDetails) BandwidthLimitMode() BandwidthControl
BandwidthLimitMode is the type of bandwidth control applied.
func (PortDetails) Duplex ¶
func (p PortDetails) Duplex() LinkDuplex
Duplex is the link duplex state of the port.
func (PortDetails) EEEEnabled ¶
func (p PortDetails) EEEEnabled() bool
EEEEnabled reports whether energy-efficient Ethernet is enabled.
func (PortDetails) Eth8021xControl ¶
func (p PortDetails) Eth8021xControl() Eth802Dot1X
Eth8021xControl is the 802.1x auth mode.
func (PortDetails) FlowControlEnabled ¶
func (p PortDetails) FlowControlEnabled() bool
FlowControlEnabled reports whether flow control is enabled.
func (PortDetails) HasEEE ¶
func (p PortDetails) HasEEE() bool
HasEEE reports whether EEE settings are available for this port.
func (PortDetails) HasFlowControl ¶
func (p PortDetails) HasFlowControl() bool
HasFlowControl reports whether flow control settings are available for this port.
func (PortDetails) HasLoopbackDetectVlanBased ¶
func (p PortDetails) HasLoopbackDetectVlanBased() bool
HasLoopbackDetectVlanBased reports whether VLAN-based loopback detection settings are available for this port.
func (PortDetails) HasProfileOverride ¶
func (p PortDetails) HasProfileOverride() bool
HasProfileOverride reports whether the port's config profile is overridden.
func (PortDetails) HasVoiceNetwork ¶
func (p PortDetails) HasVoiceNetwork() bool
HasVoiceNetwork reports whether voice network settings are available for this port.
func (PortDetails) LLDPMedEnabled ¶
func (p PortDetails) LLDPMedEnabled() bool
LLDPMedEnabled reports whether LLDP-MED is enabled.
func (PortDetails) LinkSpeed ¶
func (p PortDetails) LinkSpeed() LinkSpeed
LinkSpeed is the current link speed of the port.
func (PortDetails) LoopbackDetectEnabled ¶
func (p PortDetails) LoopbackDetectEnabled() bool
LoopbackDetectEnabled reports whether loopback detection is enabled.
func (PortDetails) LoopbackDetectVlanBasedEnabled ¶
func (p PortDetails) LoopbackDetectVlanBasedEnabled() bool
LoopbackDetectVlanBasedEnabled reports whether VLAN-based loopback detection is enabled.
func (PortDetails) MaxSpeed ¶
func (p PortDetails) MaxSpeed() LinkSpeed
MaxSpeed is the maximum speed of the port.
func (PortDetails) NativeNetworkID ¶
func (p PortDetails) NativeNetworkID() *string
NativeNetworkID is the ID of the port's native network.
func (PortDetails) NetworkTagsSetting ¶
func (p PortDetails) NetworkTagsSetting() NetworkTagsSetting
NetworkTagsSetting is the network tags setting for the port.
func (PortDetails) PoEMode ¶
func (p PortDetails) PoEMode() PoEMode
PoEMode is the PoE mode of the port. Omada may claim "enabled" on non-PoE ports (port profiles), so the mode is forced to NONE there.
func (PortDetails) PortIsolationEnabled ¶
func (p PortDetails) PortIsolationEnabled() bool
PortIsolationEnabled reports whether port isolation is enabled.
func (PortDetails) ProfileName ¶
func (p PortDetails) ProfileName() string
ProfileName is the name of the port's config profile.
func (PortDetails) SpanningTreeEnabled ¶
func (p PortDetails) SpanningTreeEnabled() bool
SpanningTreeEnabled reports whether spanning tree is enabled.
func (PortDetails) SupportsPoE ¶
func (p PortDetails) SupportsPoE() bool
SupportsPoE reports whether the port supports PoE. Older controllers do not report the field, so it defaults to true (upstream behavior).
func (PortDetails) TagIDs ¶
func (p PortDetails) TagIDs() []string
TagIDs are the IDs of the port's tagged networks.
func (PortDetails) TaggedNetworkIDs ¶
func (p PortDetails) TaggedNetworkIDs() []string
TaggedNetworkIDs are the IDs of the port's tagged networks.
func (PortDetails) TopologyNotifyEnabled ¶
func (p PortDetails) TopologyNotifyEnabled() bool
TopologyNotifyEnabled reports whether topology notify is enabled.
func (PortDetails) UntaggedNetworkIDs ¶
func (p PortDetails) UntaggedNetworkIDs() []string
UntaggedNetworkIDs are the IDs of the port's untagged networks.
func (PortDetails) VoiceNetworkEnabled ¶
func (p PortDetails) VoiceNetworkEnabled() bool
VoiceNetworkEnabled reports whether voice network is enabled for the port.
func (PortDetails) VoiceNetworkID ¶
func (p PortDetails) VoiceNetworkID() *string
VoiceNetworkID is the ID of the port's voice network.
type PortProfile ¶
type PortProfile struct {
// contains filtered or unexported fields
}
PortProfile is a switch port configuration profile.
func NewPortProfile ¶
func NewPortProfile(data map[string]any) PortProfile
NewPortProfile builds a PortProfile from a raw API object.
func (PortProfile) BandwidthLimitMode ¶
func (p PortProfile) BandwidthLimitMode() BandwidthControl
BandwidthLimitMode is the type of bandwidth control applied.
func (PortProfile) EEEEnabled ¶
func (p PortProfile) EEEEnabled() bool
EEEEnabled reports whether energy-efficient Ethernet is enabled.
func (PortProfile) Eth8021xControl ¶
func (p PortProfile) Eth8021xControl() Eth802Dot1X
Eth8021xControl is the 802.1x auth mode.
func (PortProfile) FlowControlEnabled ¶
func (p PortProfile) FlowControlEnabled() bool
FlowControlEnabled reports whether flow control is enabled.
func (PortProfile) HasEEE ¶
func (p PortProfile) HasEEE() bool
HasEEE reports whether EEE settings are available for this profile.
func (PortProfile) HasFlowControl ¶
func (p PortProfile) HasFlowControl() bool
HasFlowControl reports whether flow control settings are available for this profile.
func (PortProfile) HasLoopbackDetectVlanBased ¶
func (p PortProfile) HasLoopbackDetectVlanBased() bool
HasLoopbackDetectVlanBased reports whether VLAN-based loopback detection settings are available for this profile.
func (PortProfile) LLDPMedEnabled ¶
func (p PortProfile) LLDPMedEnabled() bool
LLDPMedEnabled reports whether LLDP-MED is enabled.
func (PortProfile) LoopbackDetectEnabled ¶
func (p PortProfile) LoopbackDetectEnabled() bool
LoopbackDetectEnabled reports whether loopback detection is enabled.
func (PortProfile) LoopbackDetectVlanBasedEnabled ¶
func (p PortProfile) LoopbackDetectVlanBasedEnabled() bool
LoopbackDetectVlanBasedEnabled reports whether VLAN-based loopback detection is enabled.
func (PortProfile) PortIsolationEnabled ¶
func (p PortProfile) PortIsolationEnabled() bool
PortIsolationEnabled reports whether port isolation is enabled.
func (PortProfile) ProfileID ¶
func (p PortProfile) ProfileID() string
ProfileID is the ID of the profile.
func (PortProfile) Site ¶
func (p PortProfile) Site() string
Site is the site the profile is valid for.
func (PortProfile) SpanningTreeEnabled ¶
func (p PortProfile) SpanningTreeEnabled() bool
SpanningTreeEnabled reports whether spanning tree is enabled.
func (PortProfile) TopologyNotifyEnabled ¶
func (p PortProfile) TopologyNotifyEnabled() bool
TopologyNotifyEnabled reports whether topology notify is enabled.
type RadioId ¶
type RadioId int32
func (RadioId) SettingsKey ¶
SettingsKey is the field name the controller uses for this radio's settings.
type RateLimit ¶
type RateLimit struct {
// contains filtered or unexported fields
}
RateLimit is the rate limit setting of a client.
func NewRateLimit ¶
NewRateLimit builds a RateLimit from a raw API object.
func (RateLimit) DownEnabled ¶
DownEnabled reports whether downstream rate limiting is enabled.
type RequestError ¶
RequestError is returned when the Omada controller answers a request with a non-zero errorCode. Code holds the controller error code, Msg the message.
func (*RequestError) Error ¶
func (e *RequestError) Error() string
func (*RequestError) Is ¶
func (e *RequestError) Is(target error) bool
Is matches ErrLoginFailed for controller error code -30109 so callers can use errors.Is with the sentinel.
type SoftwareUpdateInfo ¶
type SoftwareUpdateInfo struct {
// contains filtered or unexported fields
}
func NewSoftwareUpdateInfo ¶
func NewSoftwareUpdateInfo(m map[string]any) SoftwareUpdateInfo
NewSoftwareUpdateInfo wraps a controller software update section.
func (SoftwareUpdateInfo) CurrentVersion ¶
func (u SoftwareUpdateInfo) CurrentVersion() *string
CurrentVersion is the currently installed version, when reported.
func (SoftwareUpdateInfo) DownloadLink ¶
func (u SoftwareUpdateInfo) DownloadLink() *string
DownloadLink is the update download link, stripped; nil when absent.
func (SoftwareUpdateInfo) LatestVersion ¶
func (u SoftwareUpdateInfo) LatestVersion() *string
LatestVersion is the latest available version, falling back to the current one.
func (SoftwareUpdateInfo) ReleaseNotes ¶
func (u SoftwareUpdateInfo) ReleaseNotes() *string
ReleaseNotes is the release notes, checking both known keys.
func (SoftwareUpdateInfo) ReleaseURL ¶
func (u SoftwareUpdateInfo) ReleaseURL() *string
ReleaseURL is the release information URL, stripped; nil when absent.
type Switch ¶
type Switch struct {
Device
}
Switch is the details of a managed switch.
func (Switch) DeviceCapabilities ¶
func (s Switch) DeviceCapabilities() SwitchDeviceCaps
DeviceCapabilities are the switch capabilities.
func (Switch) NumberPorts ¶
NumberPorts is the number of ports on the switch.
type SwitchDeviceCaps ¶
type SwitchDeviceCaps struct {
// contains filtered or unexported fields
}
SwitchDeviceCaps is the capabilities of a switch.
func NewSwitchDeviceCaps ¶
func NewSwitchDeviceCaps(data map[string]any) SwitchDeviceCaps
NewSwitchDeviceCaps builds a SwitchDeviceCaps from a raw API object.
func (SwitchDeviceCaps) PoEPorts ¶
func (c SwitchDeviceCaps) PoEPorts() int
PoEPorts is the number of PoE ports supported.
func (SwitchDeviceCaps) SupportsBT ¶
func (c SwitchDeviceCaps) SupportsBT() bool
SupportsBT reports whether BT is supported.
func (SwitchDeviceCaps) SupportsPoE ¶
func (c SwitchDeviceCaps) SupportsPoE() bool
SupportsPoE reports whether PoE is supported.
type SwitchPort ¶
type SwitchPort struct {
// contains filtered or unexported fields
}
SwitchPort is a port on a switch.
func NewSwitchPort ¶
func NewSwitchPort(data map[string]any) SwitchPort
NewSwitchPort builds a SwitchPort from a raw API object.
func (SwitchPort) IsDisabled ¶
func (p SwitchPort) IsDisabled() bool
IsDisabled reports whether the port is disabled.
func (SwitchPort) Operation ¶
func (p SwitchPort) Operation() string
Operation is the port operation: switching, mirroring, or aggregating.
func (SwitchPort) PortStatus ¶
func (p SwitchPort) PortStatus() SwitchPortStatus
PortStatus is the live status of the port.
func (SwitchPort) ProfileID ¶
func (p SwitchPort) ProfileID() string
ProfileID is the ID of the port's config profile.
type SwitchPortStatus ¶
type SwitchPortStatus struct {
// contains filtered or unexported fields
}
SwitchPortStatus is the live status of a switch port.
func NewSwitchPortStatus ¶
func NewSwitchPortStatus(data map[string]any) SwitchPortStatus
NewSwitchPortStatus builds a SwitchPortStatus from a raw API object.
func (SwitchPortStatus) BytesRX ¶
func (s SwitchPortStatus) BytesRX() int
BytesRX is the number of bytes received by the port.
func (SwitchPortStatus) BytesTX ¶
func (s SwitchPortStatus) BytesTX() int
BytesTX is the number of bytes transmitted by the port.
func (SwitchPortStatus) LinkSpeed ¶
func (s SwitchPortStatus) LinkSpeed() LinkSpeed
LinkSpeed is the port link speed.
func (SwitchPortStatus) LinkStatus ¶
func (s SwitchPortStatus) LinkStatus() LinkStatus
LinkStatus is the port link status.
func (SwitchPortStatus) PoEActive ¶
func (s SwitchPortStatus) PoEActive() bool
PoEActive reports whether the port is powering a PoE device.
func (SwitchPortStatus) PoEPower ¶
func (s SwitchPortStatus) PoEPower() *float64
PoEPower is the power (W) supplied over PoE, nil when unreported.
func (SwitchPortStatus) STPDiscarding ¶
func (s SwitchPortStatus) STPDiscarding() bool
STPDiscarding reports the port's STP blocking state.
type Topology ¶
type Topology struct {
// contains filtered or unexported fields
}
Topology is the site's full physical network topology tree, rooted at its gateway(s).
func NewTopology ¶
NewTopology builds a Topology from a raw API object.
func (Topology) Roots ¶
func (t Topology) Roots() []TopologyNode
Roots are the root nodes of the topology tree (typically the site's gateway(s)).
type TopologyNode ¶
type TopologyNode struct {
// contains filtered or unexported fields
}
TopologyNode is a single node (device, or a directly-identifiable client) in the topology tree.
func NewTopologyNode ¶
func NewTopologyNode(data map[string]any) TopologyNode
NewTopologyNode builds a TopologyNode from a raw API object.
func (TopologyNode) ClientCount ¶
func (n TopologyNode) ClientCount() int
ClientCount is the number of clients attached to this node.
func (TopologyNode) Disconnected ¶
func (n TopologyNode) Disconnected() bool
Disconnected reports whether the node is currently disconnected.
func (TopologyNode) IPAddress ¶
func (n TopologyNode) IPAddress() *string
IPAddress is the IP address of the node, if known.
func (TopologyNode) Model ¶
func (n TopologyNode) Model() *string
Model is the model of the node, if it's a managed Omada device.
func (TopologyNode) Name ¶
func (n TopologyNode) Name() string
Name is the display name of the node, falling back to the MAC.
func (TopologyNode) OwnUplinkPort ¶
func (n TopologyNode) OwnUplinkPort() *string
OwnUplinkPort is the port number, on this node's own hardware, used for its uplink (switches only).
func (TopologyNode) Status ¶
func (n TopologyNode) Status() DeviceStatus
Status is the status of the node, if it's a managed Omada device.
func (TopologyNode) StatusCategory ¶
func (n TopologyNode) StatusCategory() DeviceStatusCategory
StatusCategory is the high-level status of the node.
func (TopologyNode) Successors ¶
func (n TopologyNode) Successors() []TopologyNode
Successors are the nodes plugged into this node.
func (TopologyNode) Type ¶
func (n TopologyNode) Type() string
Type is the type of node. Known values include "gateway", "switch", "ap", and "omada controller".
func (TopologyNode) UpstreamDuplex ¶
func (n TopologyNode) UpstreamDuplex() LinkDuplex
UpstreamDuplex is the negotiated duplex mode between this node and its parent.
func (TopologyNode) UpstreamLinkSpeed ¶
func (n TopologyNode) UpstreamLinkSpeed() LinkSpeed
UpstreamLinkSpeed is the negotiated link speed between this node and its parent.
func (TopologyNode) UpstreamPort ¶
func (n TopologyNode) UpstreamPort() *string
UpstreamPort is the port number, on the parent node, that this node is plugged into.
func (TopologyNode) WANPorts ¶
func (n TopologyNode) WANPorts() []TopologyWanPort
WANPorts are the WAN port health summaries, for gateway nodes.
type TopologyWanPort ¶
type TopologyWanPort struct {
// contains filtered or unexported fields
}
TopologyWanPort is a summary WAN port health entry, as reported on a gateway node in the topology tree.
func NewTopologyWanPort ¶
func NewTopologyWanPort(data map[string]any) TopologyWanPort
NewTopologyWanPort builds a TopologyWanPort from a raw API object.
func (TopologyWanPort) Duplex ¶
func (w TopologyWanPort) Duplex() LinkDuplex
Duplex is the actual duplex mode of the port.
func (TopologyWanPort) LinkSpeed ¶
func (w TopologyWanPort) LinkSpeed() LinkSpeed
LinkSpeed is the established link speed of the port.
func (TopologyWanPort) LinkStatus ¶
func (w TopologyWanPort) LinkStatus() LinkStatus
LinkStatus is the low-level connectivity status of the link.
func (TopologyWanPort) Name ¶
func (w TopologyWanPort) Name() string
Name is the port name, falling back to the port number.
func (TopologyWanPort) OnlineDetection ¶
func (w TopologyWanPort) OnlineDetection() bool
OnlineDetection reports whether regular internet ping tests are working.
func (TopologyWanPort) WANConnected ¶
func (w TopologyWanPort) WANConnected() bool
WANConnected reports whether the port is connected to the internet/WAN.
type UpdateSection ¶
type UpdateSection string
UpdateSection identifies the hardware or software half of a firmware update.
const ( // UpdateSectionHardware targets hardware (firmware) controller updates. UpdateSectionHardware UpdateSection = "hardware" // UpdateSectionSoftware targets software controller updates. UpdateSectionSoftware UpdateSection = "software" )
type ValidationError ¶
type ValidationError struct {
Msg string
}
ValidationError is returned when a caller supplies invalid input to a method.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version is a dotted Omada software version, compared numerically per segment.
func ParseVersion ¶
ParseVersion parses a dotted version string like "6.2.10.18". Each segment contributes its leading run of digits; a segment with no leading digits contributes 0. Empty input is an error.
func ParseVersionMust ¶
ParseVersionMust is ParseVersion for tests and constants; it panics on bad input.
type VlanCreate ¶
type VlanCreate struct {
// contains filtered or unexported fields
}
VlanCreate creates a single VLAN-only network; it does not configure routing or DHCP.
func NewVlanCreate ¶
func NewVlanCreate(name string, vlanID int) (VlanCreate, error)
NewVlanCreate builds a VlanCreate, validating name and VLAN ID.
func (VlanCreate) Payload ¶
func (v VlanCreate) Payload() map[string]any
Payload is the range-string create payload used by the installed editor.
type VlanUpdate ¶
type VlanUpdate struct {
// contains filtered or unexported fields
}
VlanUpdate changes the name and/or VLAN ID of a network while preserving its existing writable settings.
func NewVlanUpdate ¶
func NewVlanUpdate(name *string, vlanID *int) (VlanUpdate, error)
NewVlanUpdate builds a VlanUpdate. At least one of name/vlanID is required.
func (VlanUpdate) Name ¶
func (v VlanUpdate) Name() *string
Name is the validated name change, or nil when unchanged.
func (VlanUpdate) Payload ¶
func (v VlanUpdate) Payload(network LanNetwork) (map[string]any, error)
Payload merges the verified writable settings of network into a defensive copy, applying the requested changes.
func (VlanUpdate) VLANID ¶
func (v VlanUpdate) VLANID() *int
VLANID is the validated VLAN ID change, or nil when unchanged.
type VpnCategory ¶
type VpnCategory string
VpnCategory is the VPN tab a policy belongs to.
const ( VpnServer VpnCategory = "server" VpnClient VpnCategory = "client" VpnSiteToSite VpnCategory = "site_to_site" )
func (VpnCategory) ListEndpoint ¶
func (c VpnCategory) ListEndpoint() string
ListEndpoint is the OpenAPI list endpoint for this tab.
func (VpnCategory) String ¶
func (c VpnCategory) String() string
type VpnPolicy ¶
type VpnPolicy struct {
// contains filtered or unexported fields
}
VpnPolicy is a single VPN entry that can be enabled/disabled via .../vpn/{id}/status.
func NewVpnPolicy ¶
func NewVpnPolicy(category VpnCategory, data map[string]any) VpnPolicy
NewVpnPolicy builds a VpnPolicy from a raw API object and its tab.
func (VpnPolicy) Category ¶
func (p VpnPolicy) Category() VpnCategory
Category is the VPN tab this policy belongs to.
func (VpnPolicy) VpnType ¶
VpnType is the VPN protocol type. Unrecognized codes map to Unknown, mirroring the upstream _missing_ behavior.
func (VpnPolicy) VpnTypeName ¶
VpnTypeName is the human-readable protocol.
type WiredDetails ¶
type WiredDetails struct {
// contains filtered or unexported fields
}
WiredDetails are the wired-connection details of a client.
func NewWiredDetails ¶
func NewWiredDetails(data map[string]any) WiredDetails
NewWiredDetails builds a WiredDetails from a raw API object.
func (WiredDetails) Dot1xVlan ¶
func (w WiredDetails) Dot1xVlan() int
Dot1xVlan is the VLAN obtained by 802.1x D-VLAN.
func (WiredDetails) GatewayMAC ¶
func (w WiredDetails) GatewayMAC() *string
GatewayMAC is the MAC of the gateway the client is connected to.
func (WiredDetails) GatewayName ¶
func (w WiredDetails) GatewayName() *string
GatewayName is the name of the gateway the client is connected to.
func (WiredDetails) NetworkName ¶
func (w WiredDetails) NetworkName() string
NetworkName is the network name.
func (WiredDetails) Port ¶
func (w WiredDetails) Port() int
Port is the switch port the client is connected to.
func (WiredDetails) SwitchMAC ¶
func (w WiredDetails) SwitchMAC() *string
SwitchMAC is the MAC of the switch the client is connected to.
func (WiredDetails) SwitchName ¶
func (w WiredDetails) SwitchName() *string
SwitchName is the name of the switch the client is connected to.
type WirelessDetails ¶
type WirelessDetails struct {
// contains filtered or unexported fields
}
WirelessDetails are the wireless-connection details of a client.
func NewWirelessDetails ¶
func NewWirelessDetails(data map[string]any) WirelessDetails
NewWirelessDetails builds a WirelessDetails from a raw API object.
func (WirelessDetails) APMAC ¶
func (w WirelessDetails) APMAC() string
APMAC is the MAC address of the access point.
func (WirelessDetails) APName ¶
func (w WirelessDetails) APName() string
APName is the name of the access point.
func (WirelessDetails) Channel ¶
func (w WirelessDetails) Channel() int
Channel is the wifi channel number.
func (WirelessDetails) PowerSave ¶
func (w WirelessDetails) PowerSave() bool
PowerSave reports whether power save mode is enabled.
func (WirelessDetails) RSSI ¶
func (w WirelessDetails) RSSI() int
RSSI is the signal strength in dBm.
func (WirelessDetails) RadioID ¶
func (w WirelessDetails) RadioID() RadioId
RadioID is the radio band the client is connected on.
func (WirelessDetails) RxRate ¶
func (w WirelessDetails) RxRate() int
RxRate is the uplink negotiation rate in Kbit/s.
func (WirelessDetails) SignalLevel ¶
func (w WirelessDetails) SignalLevel() int
SignalLevel is the signal strength percentage.
func (WirelessDetails) SignalRank ¶
func (w WirelessDetails) SignalRank() int
SignalRank is the signal strength on a 0-5 scale.
func (WirelessDetails) TxRate ¶
func (w WirelessDetails) TxRate() int
TxRate is the downlink negotiation rate in Kbit/s.
func (WirelessDetails) WifiMode ¶
func (w WirelessDetails) WifiMode() WifiMode
WifiMode is the wifi mode.