Skip to content

Commit

Permalink
doc: update client and rpc usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
graugans committed Apr 14, 2024
1 parent 984d049 commit e863743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/ovp8xx/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion pkg/ovp8xx/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e863743

Please sign in to comment.