From e8637433b9f1ec406941ce0dd4e6c879a06a086e Mon Sep 17 00:00:00 2001 From: Christian Ege Date: Sun, 14 Apr 2024 10:54:46 +0200 Subject: [PATCH] doc: update client and rpc usage examples --- pkg/ovp8xx/client.go | 2 +- pkg/ovp8xx/rpc.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/ovp8xx/client.go b/pkg/ovp8xx/client.go index 79696a7..1854674 100644 --- a/pkg/ovp8xx/client.go +++ b/pkg/ovp8xx/client.go @@ -25,7 +25,7 @@ type ( // multiple client options. // Example usage: // -// client := NewClient(WithTimeout(10 * time.Second), WithRetry(3)) +// client := NewClient(WithHost("192.168.47.11")) // // ... func NewClient(opts ...ClientOption) *Client { // Initialise with default values diff --git a/pkg/ovp8xx/rpc.go b/pkg/ovp8xx/rpc.go index 6fcb592..e4604ef 100644 --- a/pkg/ovp8xx/rpc.go +++ b/pkg/ovp8xx/rpc.go @@ -20,7 +20,10 @@ func IsTimeoutError(err error) bool { // Get retrieves the configuration for the specified pointers from the OVP8xx device. // The pointers parameter is a slice of strings that contains the pointers to retrieve the configuration for. // The function returns the retrieved configuration as a Config struct and an error if any occurred. -// Example usage: config, err := device.Get([]string{"/device", "/ports"}) +// Example usage: +// +// config, err := device.Get([]string{"/device", "/ports"}) +// // ... func (device *Client) Get(pointers []string) (Config, error) { client, err := xmlrpc.NewClient(device.url) if err != nil {