Skip to content

Commit

Permalink
feat(http-client)!: add new internal service url for namespace client
Browse files Browse the repository at this point in the history
  • Loading branch information
aris1009 committed Jun 6, 2024
1 parent 7a66a7f commit 0f260de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
)

const defaultBaseUrl = "https://api.rudderstack.com"
const defaultBaseUrlV2 = "https://dp.api.rudderstack.com"

type ControlPlane struct {
baseUrl *url.URL
Expand Down Expand Up @@ -53,8 +54,10 @@ type RequestDoer interface {

func New(options ...Option) (*ControlPlane, error) {
url, _ := url.Parse(defaultBaseUrl)
urlV2, _ := url.Parse(defaultBaseUrlV2)
cp := &ControlPlane{
baseUrl: url,
baseUrlV2: urlV2,

Check failure on line 60 in sdk.go

View workflow job for this annotation

GitHub Actions / Unit

unknown field baseUrlV2 in struct literal of type ControlPlane

Check failure on line 60 in sdk.go

View workflow job for this annotation

GitHub Actions / lint

unknown field baseUrlV2 in struct literal of type ControlPlane

Check failure on line 60 in sdk.go

View workflow job for this annotation

GitHub Actions / lint

unknown field baseUrlV2 in struct literal of type ControlPlane
log: logger.NOP,
pollingInterval: 1 * time.Second,
configsCache: &cache.WorkspaceConfigCache{},
Expand Down Expand Up @@ -83,6 +86,7 @@ func (cp *ControlPlane) setupClients() error {
}

baseClient := &base.Client{HTTPClient: cp.httpClient, BaseURL: cp.baseUrl}
baseClientV2 := &base.Client{HTTPClient: cp.httpClient, BaseURL: cp.baseUrlV2}

Check failure on line 89 in sdk.go

View workflow job for this annotation

GitHub Actions / Unit

cp.baseUrlV2 undefined (type *ControlPlane has no field or method baseUrlV2)

Check failure on line 89 in sdk.go

View workflow job for this annotation

GitHub Actions / lint

cp.baseUrlV2 undefined (type *ControlPlane has no field or method baseUrlV2)) (typecheck)

Check failure on line 89 in sdk.go

View workflow job for this annotation

GitHub Actions / lint

cp.baseUrlV2 undefined (type *ControlPlane has no field or method baseUrlV2) (typecheck)

// set admin client
if cp.adminCredentials != nil {
Expand All @@ -101,7 +105,7 @@ func (cp *ControlPlane) setupClients() error {
}
} else if cp.namespaceIdentity != nil {
cp.Client = &namespace.Client{
Client: baseClient,
Client: baseClientV2,
Identity: cp.namespaceIdentity,
}
} else {
Expand Down

0 comments on commit 0f260de

Please sign in to comment.