mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
37 lines
859 B
Markdown
37 lines
859 B
Markdown
## Options
|
|
|
|
### WithServerURL
|
|
|
|
WithServerURL allows providing an alternative server URL.
|
|
|
|
```go
|
|
operations.WithServerURL("http://api.example.com")
|
|
```
|
|
|
|
## WithTemplatedServerURL
|
|
|
|
WithTemplatedServerURL allows providing an alternative server URL with templated parameters.
|
|
|
|
```go
|
|
operations.WithTemplatedServerURL("http://{host}:{port}", map[string]string{
|
|
"host": "api.example.com",
|
|
"port": "8080",
|
|
})
|
|
```
|
|
|
|
### WithRetries
|
|
|
|
WithRetries allows customizing the default retry configuration. Only usable with methods that mention they support retries.
|
|
|
|
```go
|
|
operations.WithRetries(retry.Config{
|
|
Strategy: "backoff",
|
|
Backoff: retry.BackoffStrategy{
|
|
InitialInterval: 500 * time.Millisecond,
|
|
MaxInterval: 60 * time.Second,
|
|
Exponent: 1.5,
|
|
MaxElapsedTime: 5 * time.Minute,
|
|
},
|
|
RetryConnectionErrors: true,
|
|
})
|
|
``` |