Documentation
¶
Overview ¶
Package homehub contains utilities for scraping metrics from a BT home hub.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidUpDownBytes = errors.New("invalid value for up/down bytes")
ErrInvalidUpDownBytes is the error given when the up/down bytes in the homehub's XML response cannot be parsed.
View Source
var ErrStatus = errors.New("unexpected status code")
ErrStatus is the error given when an HTTP call to the homehub returns an error status code.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
The Client type is used to interact with the BT home hub via HTTP.
func New ¶
New creates a new instance of the Client type that will scrape a BT home hub at the provided url.
type GetStatusResponse ¶
type GetStatusResponse struct { XMLName xml.Name `xml:"status"` Text string `xml:",chardata"` WanConnStatusList struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Value string `xml:"value,attr"` } `xml:"wan_conn_status_list"` WanConnVolumeList struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Value string `xml:"value,attr"` } `xml:"wan_conn_volume_list"` WanLinestatusRateList struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Value string `xml:"value,attr"` } `xml:"wan_linestatus_rate_list"` WlanChannelList struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Value string `xml:"value,attr"` } `xml:"wlan_channel_list"` Curlinkstatus struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Value string `xml:"value,attr"` } `xml:"curlinkstatus"` Sysuptime struct { Text string `xml:",chardata"` Value string `xml:"value,attr"` } `xml:"sysuptime"` StatusRate struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Value string `xml:"value,attr"` } `xml:"status_rate"` WanActiveIdx struct { Text string `xml:",chardata"` Value string `xml:"value,attr"` } `xml:"wan_active_idx"` LinkStatus struct { Text string `xml:",chardata"` Value string `xml:"value,attr"` } `xml:"link_status"` IP4InfoList struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Value string `xml:"value,attr"` } `xml:"ip4_info_list"` IP6LLAList struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Value string `xml:"value,attr"` } `xml:"ip6_lla_list"` IP6GUAList struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Value string `xml:"value,attr"` } `xml:"ip6_gua_list"` IP6RDNSList struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Value string `xml:"value,attr"` } `xml:"ip6_rdns_list"` Locktime struct { Text string `xml:",chardata"` Value string `xml:"value,attr"` } `xml:"locktime"` }
The GetStatusResponse type represents the wan_conn.xml response given by the BT home hub.
Click to show internal directories.
Click to hide internal directories.