File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ type Config struct {
2828 RetryWaitTime time.Duration
2929 // RetryMaxWaitTime defines the maximum wait time between retries.
3030 RetryMaxWaitTime time.Duration
31+
32+ // BaseURL defines the base URL for the API.
33+ BaseURL string
3134}
3235
3336type client struct {
@@ -59,6 +62,7 @@ func NewClient(opts ...clientOption) (Client, error) {
5962 RetryCount : 3 ,
6063 RetryWaitTime : 5 * time .Second ,
6164 RetryMaxWaitTime : 20 * time .Second ,
65+ BaseURL : "http://api:8080" ,
6266 },
6367 }
6468
@@ -72,7 +76,7 @@ func NewClient(opts ...clientOption) (Client, error) {
7276 httpClient .SetLogger (& LeveledLogger {c .logger })
7377 }
7478
75- httpClient .SetBaseURL ("http://api:8080" )
79+ httpClient .SetBaseURL (c . Config . BaseURL )
7680 httpClient .SetRetryCount (c .Config .RetryCount )
7781 httpClient .SetRetryWaitTime (c .Config .RetryWaitTime )
7882 httpClient .SetRetryMaxWaitTime (c .Config .RetryMaxWaitTime )
You can’t perform that action at this time.
0 commit comments