Allow retrieving the underlying configuration for APIClient (#4195)

This commit is contained in:
William Cheng
2019-10-21 16:14:00 +08:00
committed by GitHub
parent ba04939c7a
commit 90c7f53a1b
58 changed files with 1941 additions and 1874 deletions

View File

@@ -180,6 +180,12 @@ func (c *APIClient) ChangeBasePath(path string) {
c.cfg.BasePath = path
}
// Allow modification of underlying config for alternate implementations and testing
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
func (c *APIClient) GetConfig() *Configuration {
return c.cfg
}
// prepareRequest build the request
func (c *APIClient) prepareRequest(
ctx context.Context,