Documentation ¶
Overview ¶
Package livebox provides a client to easily communicate with Livebox 5's API.
This API is usually available at `http://192.168.1.1/ws`. Authentication is handled by the library, set the `admin` password and start sending requests.
Index ¶
Constants ¶
const ( DefaultAddress = "http://192.168.1.1" DefaultUsername = "admin" )
Variables ¶
var ErrInvalidCredentials = client.ErrInvalidCredentials
ErrInvalidCredentials is returned when the login is not successful because the login or password is invalid.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Livebox API Client. Requests sent using a client will be automatically authenticated using the specified password. Client is thread safe.
func NewClient ¶
NewClient returns a new Client that will be authenticated using the given password.
type Opt ¶
type Opt func(c *clientOpts)
Opt is a Livebox client option.
func WithAddress ¶
WithAddress allows using a custom Livebox address. If not used, the Livebox address is set to http://192.168.1.1.
func WithHTTPClient ¶
WithHTTPClient allows using a custom http client. If not used, the Go default HTTP client is used.
func WithLogger ¶
WithLogger attaches a logger to the client. Logging is disabled if unset.
func WithUsername ¶
WithUsername sets the username that will be used to authenticate. Defaults to "admin" if not specified.