zyxel

package
v0.0.0-...-8da4130 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHTTPUnauthorized = errors.New("HTTP responded unauthorized")
)
View Source
var (
	// Logger for allowing external routines to inject a log.Logger to this module.
	Logger = log.NewLogfmtLogger(os.Stdout)
)

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL  *url.URL
	Username string
	Password string

	http.Client
}

func NewClient

func NewClient(baseURL, username, password string) (*Client, error)

func (*Client) GetXDSLStatistics

func (c *Client) GetXDSLStatistics() (*VDSLStatus, error)

GetXDSLStatistics returns the raw

/pages/systemMonitoring/xdslStatistics/GetxdslStatistics.html

func (*Client) Login

func (c *Client) Login() error

Login into the DSL modems admin interface.

/login/login-page.cgi

func (*Client) Post

func (c *Client) Post(url, contentType string, body io.Reader) (resp *http.Response, err error)

type Delay

type Delay struct {
	time.Duration
}

Delay is a Zyxel specific type derived from time.Duration.

func (*Delay) UnmarshalText

func (d *Delay) UnmarshalText(data []byte) error

UnmarshalText parses the uptime format from Zyxel devices.

Example:

41 days: 20 hours: 46 minutes

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error)

type Uptime

type Uptime struct {
	time.Duration
}

Uptime is a Zyxel specific type derived from time.Duration.

func (*Uptime) UnmarshalText

func (d *Uptime) UnmarshalText(data []byte) error

UnmarshalText parses the uptime format from Zyxel devices.

Example:

41 days: 20 hours: 46 minutes

type VDSLStatus

type VDSLStatus struct {
	Status                 string `text:"VDSL Training Status"`
	Mode                   string
	Profile                string `text:"VDSL Profile"`
	TrafficType            string
	LinkUptime             Uptime
	LineRateUp             units.Mbps
	LineRateDown           units.Mbps
	ActualDataRateUp       units.Mbps
	ActualDataRateDown     units.Mbps
	SNRMarginUp            units.Decibel
	SNRMarginDown          units.Decibel
	ActualDelayUp          Delay
	ActualDelayDown        Delay
	TransmitPowerUp        units.DecibelMilliwatt
	TransmitPowerDown      units.DecibelMilliwatt
	ReceivePowerUp         units.DecibelMilliwatt
	ReceivePowerDown       units.DecibelMilliwatt
	AttenuationUp          units.Decibel
	AttenuationDown        units.Decibel
	AttainableDataRateUp   units.Mbps
	AttainableDataRateDown units.Mbps
}

func (*VDSLStatus) UnmarshalText

func (s *VDSLStatus) UnmarshalText(data []byte) error

UnmarshalText can parse the text output from Zyxel DSL status and convert it to native data in VDSLStatus.

For examples see directory `testdata`.

Jump to

Keyboard shortcuts

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