Skip to content

Commit

Permalink
Moving elastic-http-frontend-connector to frontend_connectors package (
Browse files Browse the repository at this point in the history
…#1136)

This PR just moves `ElasticHTTPFrontendConnectors` to the right package
(`frontend_connectors`)
  • Loading branch information
pdelewski authored Dec 23, 2024
1 parent dac1c3e commit 0108d8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
// Copyright Quesma, licensed under the Elastic License 2.0.
// SPDX-License-Identifier: Elastic-2.0

package quesma
package frontend_connectors

import (
"context"
"net/http"
"quesma/clickhouse"
"quesma/frontend_connectors"
"quesma/quesma/config"
"quesma/schema"
quesma_api "quesma_v2/core"
"quesma_v2/core/diag"
)

type ElasticHttpIngestFrontendConnector struct {
*frontend_connectors.BasicHTTPFrontendConnector
*BasicHTTPFrontendConnector

Config *config.QuesmaConfiguration

Expand All @@ -28,7 +27,7 @@ func NewElasticHttpIngestFrontendConnector(endpoint string,
config *config.QuesmaConfiguration, router quesma_api.Router) *ElasticHttpIngestFrontendConnector {

fc := &ElasticHttpIngestFrontendConnector{
BasicHTTPFrontendConnector: frontend_connectors.NewBasicHTTPFrontendConnector(endpoint, config),
BasicHTTPFrontendConnector: NewBasicHTTPFrontendConnector(endpoint, config),
}
fallback := func(ctx context.Context, req *quesma_api.Request, writer http.ResponseWriter) (*quesma_api.Result, error) {
fc.BasicHTTPFrontendConnector.GetRouterInstance().ElasticFallback(req.Decision, ctx, writer, req.OriginalRequest, []byte(req.Body), logManager, registry)
Expand All @@ -55,7 +54,7 @@ func (h *ElasticHttpIngestFrontendConnector) SetDependencies(deps quesma_api.Dep
}

type ElasticHttpQueryFrontendConnector struct {
*frontend_connectors.BasicHTTPFrontendConnector
*BasicHTTPFrontendConnector

phoneHomeClient diag.PhoneHomeClient
}
Expand All @@ -66,7 +65,7 @@ func NewElasticHttpQueryFrontendConnector(endpoint string,
config *config.QuesmaConfiguration, router quesma_api.Router) *ElasticHttpIngestFrontendConnector {

fc := &ElasticHttpIngestFrontendConnector{
BasicHTTPFrontendConnector: frontend_connectors.NewBasicHTTPFrontendConnector(endpoint, config),
BasicHTTPFrontendConnector: NewBasicHTTPFrontendConnector(endpoint, config),
}
fallback := func(ctx context.Context, req *quesma_api.Request, writer http.ResponseWriter) (*quesma_api.Result, error) {
fc.BasicHTTPFrontendConnector.GetRouterInstance().ElasticFallback(req.Decision, ctx, writer, req.OriginalRequest, []byte(req.Body), logManager, registry)
Expand Down
5 changes: 3 additions & 2 deletions quesma/quesma/dual_write_proxy_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"quesma/ab_testing"
"quesma/clickhouse"
"quesma/elasticsearch"
"quesma/frontend_connectors"
"quesma/ingest"
"quesma/logger"
"quesma/queryparser"
Expand Down Expand Up @@ -78,10 +79,10 @@ func newDualWriteProxyV2(dependencies quesma_api.Dependencies, schemaLoader clic
ingestRouter := ConfigureIngestRouterV2(config, dependencies, ingestProcessor, resolver)
searchRouter := ConfigureSearchRouterV2(config, dependencies, registry, logManager, queryProcessor, resolver)

elasticHttpIngestFrontendConnector := NewElasticHttpIngestFrontendConnector(":"+strconv.Itoa(int(config.PublicTcpPort)),
elasticHttpIngestFrontendConnector := frontend_connectors.NewElasticHttpIngestFrontendConnector(":"+strconv.Itoa(int(config.PublicTcpPort)),
logManager, registry, config, ingestRouter)

elasticHttpQueryFrontendConnector := NewElasticHttpQueryFrontendConnector(":"+strconv.Itoa(int(config.PublicTcpPort)),
elasticHttpQueryFrontendConnector := frontend_connectors.NewElasticHttpQueryFrontendConnector(":"+strconv.Itoa(int(config.PublicTcpPort)),
logManager, registry, config, searchRouter)

quesmaBuilder := quesma_api.NewQuesma(dependencies)
Expand Down

0 comments on commit 0108d8a

Please sign in to comment.