Documentation ¶
Index ¶
- type BandwidthLog
- type BandwidthLogEntry
- type ConnectionDetail
- type DeviceDetail
- type EventLog
- type EventLogEntry
- type Hub
- type HubClient
- func (h *HubClient) BandwidthMonitor() (result *BandwidthLog, err error)
- func (h *HubClient) BroadbandProductType() (result string, err error)
- func (h *HubClient) ConnectedDevices() (result []DeviceDetail, err error)
- func (h *HubClient) DataPumpVersion() (result string, err error)
- func (h *HubClient) DataReceived() (result int64, err error)
- func (h *HubClient) DataSent() (result int64, err error)
- func (h *HubClient) DeviceInfo(id int) (result *DeviceDetail, err error)
- func (h *HubClient) DhcpAuthoritative() (result bool, err error)
- func (h *HubClient) DhcpPoolEnd() (result string, err error)
- func (h *HubClient) DhcpPoolStart() (result string, err error)
- func (h *HubClient) DhcpSubnetMask() (result string, err error)
- func (h *HubClient) DownstreamSyncSpeed() (result int, err error)
- func (h *HubClient) EnableDebug(enable bool)
- func (h *HubClient) EnableDhcpAuthoritative(enable bool) (err error)
- func (h *HubClient) EventLog() (result *EventLog, err error)
- func (h *HubClient) HardwareVersion() (result string, err error)
- func (h *HubClient) InternetConnectionStatus() (result string, err error)
- func (h *HubClient) LightBrightness() (result int, err error)
- func (h *HubClient) LightBrightnessSet(brightness int) (err error)
- func (h *HubClient) LightEnable(enable bool) (err error)
- func (h *HubClient) LightStatus() (result string, err error)
- func (h *HubClient) LocalTime() (result string, err error)
- func (h *HubClient) Login() (success bool, err error)
- func (h *HubClient) MaintenanceFirmwareVersion() (result string, err error)
- func (h *HubClient) NatRule(id int) (result *NatRule, err error)
- func (h *HubClient) NatRuleCreate(natRule *NatRule) (err error)
- func (h *HubClient) NatRuleDelete(id int) (err error)
- func (h *HubClient) NatRuleUpdate(natRule NatRule) (err error)
- func (h *HubClient) NatRules() (result []NatRule, err error)
- func (h *HubClient) PublicIPAddress() (result string, err error)
- func (h *HubClient) PublicSubnetMask() (result string, err error)
- func (h *HubClient) Reboot() (err error)
- func (h *HubClient) SambaHost() (result string, err error)
- func (h *HubClient) SambaIP() (result string, err error)
- func (h *HubClient) SerialNumber() (result string, err error)
- func (h *HubClient) SoftwareVersion() (result string, err error)
- func (h *HubClient) UpstreamSyncSpeed() (result int, err error)
- func (h *HubClient) Version() (result string, err error)
- func (h *HubClient) WiFiFrequency24Ghz() (result *WiFiFrequency, err error)
- func (h *HubClient) WiFiFrequency24GhzChannelSet(channel int) (err error)
- func (h *HubClient) WiFiFrequency5Ghz() (result *WiFiFrequency, err error)
- func (h *HubClient) WiFiFrequency5GhzChannelSet(channel int) (err error)
- func (h *HubClient) WiFiSSID() (result string, err error)
- func (h *HubClient) WiFiSecurityMode() (result string, err error)
- type IPAddress
- type NatRule
- type WiFiFrequency
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BandwidthLog ¶ added in v0.4.0
type BandwidthLog struct {
Entries []BandwidthLogEntry
}
BandwidthLog defines a Home Hub device bandwidth log history
type BandwidthLogEntry ¶ added in v0.4.0
type BandwidthLogEntry struct { MACAddress string Date string DownloadMegabytes int UploadMegabytes int }
BandwidthLogEntry defines a Home Hub bandwidth log entry
type ConnectionDetail ¶ added in v0.3.0
type ConnectionDetail struct { UID int `json:"uid,omitempty"` ConnectionTimestamp string `json:"ConnectionTimestamp,omitempty"` DisconnectTimestamp string `json:"DisconnectionTimestamp,omitempty"` }
ConnectionDetail defines connection information related to a device connected to the Home Hub
type DeviceDetail ¶ added in v0.3.0
type DeviceDetail struct { UID int `json:"uid,omitempty"` Alias string `json:"Alias,omitempty"` PhysicalAddress string `json:"PhysAddress,omitempty"` IPAddress string `json:"IPAddress,omitempty"` AddressSource string `json:"AddressSource,omitempty"` DHCPClient string `json:"DHCPClient,omitempty"` LeaseTimeRemaining int `json:"LeaseTimeRemaining,omitempty"` AssociatedDevice string `json:"AssociatedDevice,omitempty"` HostName string `json:"HostName,omitempty"` Active bool `json:"Active,omitempty"` LeaseStart int `json:"LeaseStart,omitempty"` LeaseDuration int `json:"LeaseDuration,omitempty"` InterfaceType string `json:"InterfaceType,omitempty"` DetectedDeviceType string `json:"DetectedDeviceType,omitempty"` LastStateChange string `json:"LastStateChange,omitempty"` UserFriendlyName string `json:"UserFriendlyName,omitempty"` UserHostName string `json:"UserHostName,omitempty"` UserDeviceType string `json:"UserDeviceType,omitempty"` BlacklistEnable bool `json:"BlacklistEnable,omitempty"` UnblockHours int `json:"UnblockHoursCount,omitempty"` Blacklisted bool `json:"Blacklisted,omitempty"` BlacklistStatus bool `json:"BlacklistStatus,omitempty"` BlacklistedAccordingToSchedule bool `json:"BlacklistedAccordingToSchedule,omitempty"` Hidden bool `json:"Hidden,omitempty"` IPv4Addresses []IPAddress `json:"IPv4Addresses,omitempty"` IPv6Addresses []IPAddress `json:"IPv6Addresses,omitempty"` LastConnections []ConnectionDetail `json:"LastConnections,omitempty"` ConnectionsAtLastReboot int `json:"ConnectionsNbreAtLastReboot,omitempty"` }
DeviceDetail defines a device connected to the Home Hub
type EventLog ¶ added in v0.3.0
type EventLog struct {
Entries []EventLogEntry
}
EventLog defines a Home Hub event log history
type EventLogEntry ¶ added in v0.3.0
EventLogEntry defines a Home Hub event log entry
type Hub ¶
type Hub interface { BandwidthMonitor() (result *BandwidthLog, err error) BroadbandProductType() (result string, err error) ConnectedDevices() (result []DeviceDetail, err error) DataPumpVersion() (result string, err error) DataReceived() (result int64, err error) DataSent() (result int64, err error) DeviceInfo(id int) (result *DeviceDetail, err error) DhcpAuthoritative() (result bool, err error) DhcpPoolStart() (result string, err error) DhcpPoolEnd() (result string, err error) DhcpSubnetMask() (result string, err error) DownstreamSyncSpeed() (result int, err error) EnableDebug(enable bool) EnableDhcpAuthoritative(enable bool) (err error) EventLog() (result *EventLog, err error) HardwareVersion() (result string, err error) InternetConnectionStatus() (result string, err error) LightBrightness() (result int, err error) LightBrightnessSet(brightness int) (err error) LightEnable(enable bool) (err error) LightStatus() (result string, err error) LocalTime() (result string, err error) Login() (success bool, err error) MaintenanceFirmwareVersion() (result string, err error) NatRules() (result []NatRule, err error) NatRule(id int) (result *NatRule, err error) NatRuleCreate(natRule *NatRule) (err error) NatRuleDelete(id int) (err error) NatRuleUpdate(natRule NatRule) (err error) PublicIPAddress() (result string, err error) PublicSubnetMask() (result string, err error) Reboot() (err error) SambaIP() (result string, err error) SambaHost() (result string, err error) SerialNumber() (result string, err error) SoftwareVersion() (result string, err error) UpstreamSyncSpeed() (result int, err error) Version() (result string, err error) WiFiFrequency24Ghz() (result *WiFiFrequency, err error) WiFiFrequency24GhzChannelSet(channel int) (err error) WiFiFrequency5Ghz() (result *WiFiFrequency, err error) WiFiFrequency5GhzChannelSet(channel int) (err error) WiFiSecurityMode() (result string, err error) WiFiSSID() (result string, err error) }
Hub defines an interface for a Home Hub client
type HubClient ¶ added in v0.9.0
type HubClient struct {
// contains filtered or unexported fields
}
HubClient represents a Home Hub client for interacting with the router
func (*HubClient) BandwidthMonitor ¶ added in v0.9.0
func (h *HubClient) BandwidthMonitor() (result *BandwidthLog, err error)
BandwidthMonitor returns bandwidth statistics for devices that have connected to the router
func (*HubClient) BroadbandProductType ¶ added in v0.9.0
BroadbandProductType returns the last used wan interface type. For BT this equates to the broadband product type
func (*HubClient) ConnectedDevices ¶ added in v0.9.0
func (h *HubClient) ConnectedDevices() (result []DeviceDetail, err error)
ConnectedDevices returns information about any devices connected to the router
func (*HubClient) DataPumpVersion ¶ added in v0.9.0
DataPumpVersion returns the DSL line firmware version
func (*HubClient) DataReceived ¶ added in v0.9.0
DataReceived returns the the total data bytes received
func (*HubClient) DeviceInfo ¶ added in v0.9.0
func (h *HubClient) DeviceInfo(id int) (result *DeviceDetail, err error)
DeviceInfo returns infomation about a device matching the specified id
func (*HubClient) DhcpAuthoritative ¶ added in v0.9.0
DhcpAuthoritative returns whether the hub is the authoritive DHCP server
func (*HubClient) DhcpPoolEnd ¶ added in v0.9.0
DhcpPoolEnd returns DHCP pool end IP adress
func (*HubClient) DhcpPoolStart ¶ added in v0.9.0
DhcpPoolStart returns DHCP pool start IP adress
func (*HubClient) DhcpSubnetMask ¶ added in v0.9.0
DhcpSubnetMask returns DHCP subnet mask
func (*HubClient) DownstreamSyncSpeed ¶ added in v0.9.0
DownstreamSyncSpeed returns the speed at which the router is downloading data
func (*HubClient) EnableDebug ¶ added in v0.9.0
EnableDebug causes HTTP client request and responses to be output to the console
func (*HubClient) EnableDhcpAuthoritative ¶ added in v0.9.0
EnableDhcpAuthoritative toggles whether the hub is the authoritive DHCP server
func (*HubClient) EventLog ¶ added in v0.9.0
EventLog returns the events that have taken place on the router since it was last reset
func (*HubClient) HardwareVersion ¶ added in v0.9.0
HardwareVersion returns the router hardware version
func (*HubClient) InternetConnectionStatus ¶ added in v0.9.0
InternetConnectionStatus returns the internet connection status
func (*HubClient) LightBrightness ¶ added in v0.9.0
LightBrightness returns the router LED brightness percentage
func (*HubClient) LightBrightnessSet ¶ added in v0.9.0
LightBrightnessSet sets the router LED brightness percentage
func (*HubClient) LightEnable ¶ added in v0.9.0
LightEnable toggles the status of the router LED lights
func (*HubClient) LightStatus ¶ added in v0.9.0
LightStatus returns the router LED light satus
func (*HubClient) LocalTime ¶ added in v0.9.0
LocalTime returns the local time from the router NTP server
func (*HubClient) MaintenanceFirmwareVersion ¶ added in v0.9.0
MaintenanceFirmwareVersion returns the maintenance firmware version
func (*HubClient) NatRule ¶ added in v0.9.0
NatRule returns an IPV4 firewall NAT rule matching the specified id
func (*HubClient) NatRuleCreate ¶ added in v0.9.0
NatRuleCreate creates an IPV4 firewall NAT rule
func (*HubClient) NatRuleDelete ¶ added in v0.9.0
NatRuleDelete deletes an IPV4 firewall NAT rule
func (*HubClient) NatRuleUpdate ¶ added in v0.9.0
NatRuleUpdate updates an existing IPV4 firewall NAT rule
func (*HubClient) PublicIPAddress ¶ added in v0.9.0
PublicIPAddress returns the router public IP address
func (*HubClient) PublicSubnetMask ¶ added in v0.9.0
PublicSubnetMask returns the router public subnet mask
func (*HubClient) SambaHost ¶ added in v0.9.0
SambaHost returns a comma delimited list of samba host names
func (*HubClient) SerialNumber ¶ added in v0.9.0
SerialNumber returns the router serial number
func (*HubClient) SoftwareVersion ¶ added in v0.9.0
SoftwareVersion returns the router software version
func (*HubClient) UpstreamSyncSpeed ¶ added in v0.9.0
UpstreamSyncSpeed returns the speed at which the router is uploading data
func (*HubClient) WiFiFrequency24Ghz ¶ added in v0.9.0
func (h *HubClient) WiFiFrequency24Ghz() (result *WiFiFrequency, err error)
WiFiFrequency24Ghz returns information about the WiFI 2.4GHz frequency
func (*HubClient) WiFiFrequency24GhzChannelSet ¶ added in v0.9.0
WiFiFrequency24GhzChannelSet sets the operating channel for the 2.4Ghz frequency
func (*HubClient) WiFiFrequency5Ghz ¶ added in v0.9.0
func (h *HubClient) WiFiFrequency5Ghz() (result *WiFiFrequency, err error)
WiFiFrequency5Ghz returns information about the WiFI 5GHz frequency
func (*HubClient) WiFiFrequency5GhzChannelSet ¶ added in v0.9.0
WiFiFrequency5GhzChannelSet sets the operating channel for the 5Ghz frequency
func (*HubClient) WiFiSecurityMode ¶ added in v0.9.0
WiFiSecurityMode returns the WiFi security mode in use
type IPAddress ¶ added in v0.3.0
type IPAddress struct { UID int `json:"uid,omitempty"` IPAddress string `json:"IPAddress,omitempty"` Active bool `json:"Active,omitempty"` }
IPAddress defines an IPV4 or IPV6 address
type NatRule ¶ added in v0.5.0
type NatRule struct { UID int `json:"uid"` Enable bool `json:"Enable"` Alias string `json:"Alias"` ExternalInterface string `json:"ExternalInterface"` AllExternalInterfaces bool `json:"AllExternalInterfaces"` LeaseDuration int `json:"LeaseDuration"` RemoteHost string `json:"RemoteHost"` ExternalPort int `json:"ExternalPort"` ExternalPortEndRange int `json:"ExternalPortEndRange"` InternalInterface string `json:"InternalInterface"` InternalPort int `json:"InternalPort"` Protocol string `json:"Protocol"` Service string `json:"Service"` InternalClient string `json:"InternalClient"` Description string `json:"Description"` Creator string `json:"Creator"` Target string `json:"Target"` LeaseStart string `json:"LeaseStart"` }
NatRule represents a Home Hub NAT port forwarding rule
type WiFiFrequency ¶ added in v0.7.0
type WiFiFrequency struct { UID int `json:"uid"` Enable bool `json:"Enable"` Alias string `json:"Alias"` Status string `json:"Status"` SupportedStandards string `json:"SupportedStandards"` OperatingStandards string `json:"OperatingStandards"` AvailableChannels string `json:"ChannelsInUse"` Channel int `json:"Channel"` }
WiFiFrequency represents a Home Hub wireless frequency
Source Files ¶
- auth.go
- bandwidth_log.go
- bandwidth_monitor_request.go
- client.go
- debug.go
- device_detail.go
- event_log.go
- event_log_request.go
- firmware.go
- firmware_SG4B1.go
- firmware_SG4B1A.go
- hub.go
- hub_resource_request.go
- login_request.go
- methods.go
- nat_rule.go
- reboot_request.go
- request.go
- response.go
- response_mapping.go
- wifi_frequency.go
- xpath.go
- xpath_request.go