Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eppoclient/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package eppoclient

import (
"fmt"
"net/http"
"time"

"go.uber.org/zap"
Expand All @@ -16,6 +17,7 @@ type Config struct {
AssignmentLogger IAssignmentLogger
PollerInterval time.Duration
ApplicationLogger ApplicationLogger
HttpClient *http.Client
}

func (cfg *Config) validate() error {
Expand Down
8 changes: 7 additions & 1 deletion eppoclient/initclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ func InitClient(config Config) (*EppoClient, error) {
sdkParams := SDKParams{sdkKey: config.SdkKey, sdkName: "go", sdkVersion: __version__}
applicationLogger := config.ApplicationLogger

httpClient := newHttpClient(config.BaseUrl, &http.Client{Timeout: REQUEST_TIMEOUT_SECONDS}, sdkParams)
var httpClientInstance *http.Client
if config.HttpClient != nil {
httpClientInstance = config.HttpClient
} else {
httpClientInstance = &http.Client{Timeout: REQUEST_TIMEOUT_SECONDS}
}
httpClient := newHttpClient(config.BaseUrl, httpClientInstance, sdkParams)
configStore := newConfigurationStore()
requestor := newConfigurationRequestor(*httpClient, configStore, applicationLogger)

Expand Down
Loading