Merged in feature/demo (pull request #116)
Demo prep + Fix client sync * firstversion * clientsync * configlint * fixtests
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"queryorchestration/internal/client"
|
||||
clientupdate "queryorchestration/internal/client/update"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
@@ -47,7 +48,7 @@ func (s *Controllers) UpdateClient(ctx echo.Context, id ClientID) error {
|
||||
return echo.NewHTTPError(http.StatusBadRequest, err)
|
||||
}
|
||||
|
||||
err := s.svc.Client.Update(ctx.Request().Context(), id, &client.Update{
|
||||
err := s.svc.ClientUpdate.Update(ctx.Request().Context(), id, &clientupdate.Update{
|
||||
Name: req.Name,
|
||||
CanSync: req.CanSync,
|
||||
})
|
||||
|
||||
@@ -10,8 +10,10 @@ import (
|
||||
|
||||
queryapi "queryorchestration/api/queryAPI"
|
||||
"queryorchestration/internal/client"
|
||||
clientupdate "queryorchestration/internal/client/update"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
"queryorchestration/internal/serviceconfig/queue/clientsync"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/pashagolub/pgxmock/v3"
|
||||
@@ -19,6 +21,11 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
type ClientConfig struct {
|
||||
serviceconfig.BaseConfig
|
||||
clientsync.ConfigProvider
|
||||
}
|
||||
|
||||
func TestCreateClient(t *testing.T) {
|
||||
pool, err := pgxmock.NewPool()
|
||||
require.NoError(t, err)
|
||||
@@ -97,12 +104,14 @@ func TestUpdateClient(t *testing.T) {
|
||||
pool, err := pgxmock.NewPool()
|
||||
require.NoError(t, err)
|
||||
|
||||
cfg := &serviceconfig.BaseConfig{}
|
||||
cfg := &ClientConfig{}
|
||||
cfg.DBPool = pool
|
||||
cfg.DBQueries = repository.New(pool)
|
||||
|
||||
cons := queryapi.NewControllers(&queryapi.Services{
|
||||
Client: client.New(cfg),
|
||||
ClientUpdate: clientupdate.New(cfg, &clientupdate.Services{
|
||||
Client: client.New(cfg),
|
||||
}),
|
||||
})
|
||||
|
||||
cs := false
|
||||
|
||||
@@ -2,6 +2,7 @@ package queryapi
|
||||
|
||||
import (
|
||||
"queryorchestration/internal/client"
|
||||
clientupdate "queryorchestration/internal/client/update"
|
||||
"queryorchestration/internal/collector"
|
||||
collectorset "queryorchestration/internal/collector/set"
|
||||
"queryorchestration/internal/document"
|
||||
@@ -21,6 +22,7 @@ type Services struct {
|
||||
QueryUpdate *queryupdate.Service
|
||||
QueryTest *querytest.Service
|
||||
Client *client.Service
|
||||
ClientUpdate *clientupdate.Service
|
||||
Document *document.Service
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@ type Region string
|
||||
type EventS3 string
|
||||
|
||||
const (
|
||||
EventS3ObjectCreatedPut = "ObjectCreated:Put"
|
||||
EventS3ObjectCreatedPut = "ObjectCreated:Put"
|
||||
EventS3ObjectCreatedCompleteMultipartUpload = "ObjectCreated:CompleteMultipartUpload"
|
||||
)
|
||||
|
||||
func (s Runner) Process(ctx context.Context, body S3EventNotification) bool {
|
||||
|
||||
Reference in New Issue
Block a user