Skip to content

Commit

Permalink
Removing redundant dependency injection code as all this is handled b…
Browse files Browse the repository at this point in the history
…y embedded object
  • Loading branch information
pdelewski committed Dec 23, 2024
1 parent 0108d8a commit a3ee5a6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
32 changes: 0 additions & 32 deletions quesma/frontend_connectors/elastic_http_frontend_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@ import (
"quesma/quesma/config"
"quesma/schema"
quesma_api "quesma_v2/core"
"quesma_v2/core/diag"
)

type ElasticHttpIngestFrontendConnector struct {
*BasicHTTPFrontendConnector

Config *config.QuesmaConfiguration

phoneHomeClient diag.PhoneHomeClient
}

func NewElasticHttpIngestFrontendConnector(endpoint string,
Expand All @@ -40,23 +35,8 @@ func NewElasticHttpIngestFrontendConnector(endpoint string,
return fc
}

func (h *ElasticHttpIngestFrontendConnector) GetChildComponents() []interface{} {
components := make([]interface{}, 0)
if h.BasicHTTPFrontendConnector != nil {
components = append(components, h.BasicHTTPFrontendConnector)
}

return components
}

func (h *ElasticHttpIngestFrontendConnector) SetDependencies(deps quesma_api.Dependencies) {
h.phoneHomeClient = deps.PhoneHomeAgent()
}

type ElasticHttpQueryFrontendConnector struct {
*BasicHTTPFrontendConnector

phoneHomeClient diag.PhoneHomeClient
}

func NewElasticHttpQueryFrontendConnector(endpoint string,
Expand All @@ -75,15 +55,3 @@ func NewElasticHttpQueryFrontendConnector(endpoint string,
fc.AddRouter(router)
return fc
}

func (h *ElasticHttpQueryFrontendConnector) GetChildComponents() []interface{} {
components := make([]interface{}, 0)
if h.BasicHTTPFrontendConnector != nil {
components = append(components, h.BasicHTTPFrontendConnector)
}
return components
}

func (h *ElasticHttpQueryFrontendConnector) SetDependencies(deps quesma_api.Dependencies) {
h.phoneHomeClient = deps.PhoneHomeAgent()
}
2 changes: 1 addition & 1 deletion quesma/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func constructQuesma(cfg *config.QuesmaConfiguration, sl clickhouse.TableDiscove
if cfg.TransparentProxy {
return quesma.NewQuesmaTcpProxy(cfg, quesmaManagementConsole, logChan, false)
} else {
const quesma_v2 = false
const quesma_v2 = true
return quesma.NewHttpProxy(phoneHomeAgent, lm, ip, sl, im, schemaRegistry, cfg, quesmaManagementConsole, abResultsrepository, indexRegistry, quesma_v2)
}
}

0 comments on commit a3ee5a6

Please sign in to comment.