Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLogoutError ¶
IsLogoutError checks if an error is a LogoutError
Types ¶
type CableModem ¶
type CableModem struct {
HWVersion string `json:"hw_version"`
Vendor string `json:"vendor"`
BOOTVersion string `json:"boot_version"`
CoreVersion string `json:"core_version"`
Model string `json:"model"`
ProductType string `json:"product_type"`
FlashPart string `json:"flash_part"`
DownloadVersion string `json:"download_version"`
}
CableModem represents the cable modem hardware information
type Channel ¶
type Channel struct {
ChannelID string `json:"channel_id"`
LockStatus string `json:"lock_status"`
Frequency string `json:"frequency"`
SNR string `json:"snr,omitempty"` // Only for downstream
PowerLevel string `json:"power_level"`
Modulation string `json:"modulation"`
SymbolRate string `json:"symbol_rate,omitempty"` // Only for upstream
ChannelType string `json:"channel_type,omitempty"` // Only for upstream
}
Channel represents a downstream or upstream channel
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the modem HTTP client
func (*Client) FetchModemInfo ¶
FetchModemInfo fetches and parses modem information
func (*Client) LoginAndFetch ¶
LoginAndFetch performs login and then fetches modem information
func (*Client) SetCredentials ¶
SetCredentials sets the username and password for authentication
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database represents the SQLite database for storing modem history
func NewDatabase ¶
NewDatabase creates a new database connection and initializes tables
func (*Database) EndSession ¶
EndSession marks a session as ended
func (*Database) ExportData ¶
func (d *Database) ExportData(mode ExportMode, sessionID int64) (*ExportResult, error)
ExportData exports data based on the specified mode
func (*Database) StartSession ¶
StartSession creates a new session and returns its ID
type DownstreamExport ¶
type ErrorChannel ¶
type ErrorChannel struct {
ChannelID string `json:"channel_id"`
UnerroredCodewords string `json:"unerrored_codewords"`
CorrectableCodewords string `json:"correctable_codewords"`
UncorrectableCodewords string `json:"uncorrectable_codewords"`
}
ErrorChannel represents error codeword information for a channel
type ErrorExport ¶
type ExportMode ¶
type ExportMode int
ExportMode represents different export modes
const ( ExportCurrent ExportMode = iota ExportSession ExportAll )
type ExportResult ¶
type ExportResult struct {
Downstream []DownstreamExport
Upstream []UpstreamExport
Errors []ErrorExport
}
ExportResult holds exported data
type LogoutError ¶
type LogoutError struct {
Message string
}
LogoutError represents an error when the user is logged out and needs to authenticate
func (LogoutError) Error ¶
func (e LogoutError) Error() string
type ModemInfo ¶
type ModemInfo struct {
CableModem CableModem `json:"cable_modem"`
Downstream []Channel `json:"downstream"`
Upstream []Channel `json:"upstream"`
ErrorCodewords []ErrorChannel `json:"error_codewords"`
LastUpdated time.Time `json:"last_updated"`
}
ModemInfo represents the complete modem information
type StoredCookie ¶
type StoredCookie struct {
Name string `json:"name"`
Value string `json:"value"`
Domain string `json:"domain"`
Path string `json:"path"`
Expires time.Time `json:"expires"`
Secure bool `json:"secure"`
HttpOnly bool `json:"httpOnly"`
}
StoredCookie represents a cookie that can be serialized to JSON