From 6a90e6179ae508c0df435cafe4d8fd4ade64b316 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Fri, 27 Dec 2024 15:27:34 +0100 Subject: [PATCH] stylecheck --- services/property-svc/cmd/service/main.go | 14 +++++++------- services/property-svc/cmd/service/replay.go | 8 ++++---- .../set_spicedb_projection.go | 2 +- .../property_value_postgres_projection.go | 2 +- .../property_rules_postgres.go | 2 +- .../property_rules_postgres_test.go | 2 +- .../postgres_projection.go | 2 +- .../property_spicedb_projection.go | 2 +- services/tasks-svc/cmd/service/main.go | 15 +++++++-------- .../patient_postgres_projection.go | 2 +- .../patient_spicedb_projection.go | 2 +- .../internal/task-template/task_template.go | 2 +- .../task_postgres_projection.go | 2 +- .../spicedb.go | 2 +- 14 files changed, 29 insertions(+), 30 deletions(-) rename services/property-svc/internal/property-set/projections/{spiceDBProjection => spicedb-projection}/set_spicedb_projection.go (98%) rename services/property-svc/internal/property-value/projections/{property_value_postgres_projection => postgres-projection}/property_value_postgres_projection.go (99%) rename services/property-svc/internal/property-view/projections/{property_rules_postgres => postgres-projection}/property_rules_postgres.go (99%) rename services/property-svc/internal/property-view/projections/{property_rules_postgres => postgres-projection}/property_rules_postgres_test.go (99%) rename services/property-svc/internal/property/projections/{postgres_projection => postgres-projection}/postgres_projection.go (99%) rename services/property-svc/internal/property/projections/{spiceDBProjection => spicedb-projection}/property_spicedb_projection.go (98%) rename services/tasks-svc/internal/patient/projections/{patientPostgresProjection => postgres-projection}/patient_postgres_projection.go (99%) rename services/tasks-svc/internal/patient/projections/{patientSpiceDBProjection => spicedb-projection}/patient_spicedb_projection.go (98%) rename services/tasks-svc/internal/task/projections/{task_postgres_projection => postgres-projection}/task_postgres_projection.go (99%) rename services/tasks-svc/internal/task/projections/{task_spicedb => spicedb-projection}/spicedb.go (98%) diff --git a/services/property-svc/cmd/service/main.go b/services/property-svc/cmd/service/main.go index 62451d966..1a10bb52f 100644 --- a/services/property-svc/cmd/service/main.go +++ b/services/property-svc/cmd/service/main.go @@ -13,17 +13,17 @@ import ( hwspicedb "hwauthz/spicedb" propertySet "property-svc/internal/property-set/api" psh "property-svc/internal/property-set/handlers" - propertySetSpiceDBProjection "property-svc/internal/property-set/projections/spiceDBProjection" + propertySetSpiceDBProjection "property-svc/internal/property-set/projections/spicedb-projection" propertyValue "property-svc/internal/property-value/api" pvh "property-svc/internal/property-value/handlers" - "property-svc/internal/property-value/projections/property_value_postgres_projection" + propertyValuePostgresProjection "property-svc/internal/property-value/projections/postgres-projection" propertyViews "property-svc/internal/property-view/api" pvih "property-svc/internal/property-view/handlers" - "property-svc/internal/property-view/projections/property_rules_postgres" + propertyRulesPostgresProjection "property-svc/internal/property-view/projections/postgres-projection" property "property-svc/internal/property/api" ph "property-svc/internal/property/handlers" - propertyPostgresProjection "property-svc/internal/property/projections/postgres_projection" - propertySpiceDBProjection "property-svc/internal/property/projections/spiceDBProjection" + propertyPostgresProjection "property-svc/internal/property/projections/postgres-projection" + propertySpiceDBProjection "property-svc/internal/property/projections/spicedb-projection" ) const ServiceName = "property-svc" @@ -57,8 +57,8 @@ func Main(version string, ready func()) { propertySpiceDBProjection.NewProjection(eventStore, ServiceName, authz), propertySetSpiceDBProjection.NewProjection(eventStore, ServiceName, authz), propertyPostgresProjection.NewProjection(eventStore, ServiceName, hwdb.GetDB()), - property_value_postgres_projection.NewProjection(eventStore, ServiceName, hwdb.GetDB()), - property_rules_postgres.NewProjection(eventStore, ServiceName), + propertyValuePostgresProjection.NewProjection(eventStore, ServiceName, hwdb.GetDB()), + propertyRulesPostgresProjection.NewProjection(eventStore, ServiceName), ) propertyHandlers := ph.NewPropertyHandlers(aggregateStore, authz) diff --git a/services/property-svc/cmd/service/replay.go b/services/property-svc/cmd/service/replay.go index e89838cfe..846ba9de8 100644 --- a/services/property-svc/cmd/service/replay.go +++ b/services/property-svc/cmd/service/replay.go @@ -11,9 +11,9 @@ import ( "github.com/EventStore/EventStore-Client-Go/v4/esdb" propertyValueAggregate "property-svc/internal/property-value/aggregate" - "property-svc/internal/property-value/projections/property_value_postgres_projection" + propertyValuePostgresProjection "property-svc/internal/property-value/projections/postgres-projection" propertyAggregate "property-svc/internal/property/aggregate" - "property-svc/internal/property/projections/postgres_projection" + propertyPostgresProjection "property-svc/internal/property/projections/postgres-projection" ) // replay mechanism for projections of the property-svc @@ -39,8 +39,8 @@ func replay(ctx context.Context, eventStore *esdb.Client) error { log.Info().Msg("starting event replay") - propertyPostgresProjection := postgres_projection.NewProjection(eventStore, ServiceName, tx) - propertyValuePostgresProjection := property_value_postgres_projection.NewProjection(eventStore, ServiceName, tx) + propertyPostgresProjection := propertyPostgresProjection.NewProjection(eventStore, ServiceName, tx) + propertyValuePostgresProjection := propertyValuePostgresProjection.NewProjection(eventStore, ServiceName, tx) err = eventstoredb.Replay( ctx, diff --git a/services/property-svc/internal/property-set/projections/spiceDBProjection/set_spicedb_projection.go b/services/property-svc/internal/property-set/projections/spicedb-projection/set_spicedb_projection.go similarity index 98% rename from services/property-svc/internal/property-set/projections/spiceDBProjection/set_spicedb_projection.go rename to services/property-svc/internal/property-set/projections/spicedb-projection/set_spicedb_projection.go index 07432d8fc..3529bfc1a 100644 --- a/services/property-svc/internal/property-set/projections/spiceDBProjection/set_spicedb_projection.go +++ b/services/property-svc/internal/property-set/projections/spicedb-projection/set_spicedb_projection.go @@ -1,4 +1,4 @@ -package spiceDBProjection +package spicedbprojection import ( "context" diff --git a/services/property-svc/internal/property-value/projections/property_value_postgres_projection/property_value_postgres_projection.go b/services/property-svc/internal/property-value/projections/postgres-projection/property_value_postgres_projection.go similarity index 99% rename from services/property-svc/internal/property-value/projections/property_value_postgres_projection/property_value_postgres_projection.go rename to services/property-svc/internal/property-value/projections/postgres-projection/property_value_postgres_projection.go index 13de08ae1..f37411470 100644 --- a/services/property-svc/internal/property-value/projections/property_value_postgres_projection/property_value_postgres_projection.go +++ b/services/property-svc/internal/property-value/projections/postgres-projection/property_value_postgres_projection.go @@ -1,4 +1,4 @@ -package property_value_postgres_projection +package postgresprojection import ( "context" diff --git a/services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres.go b/services/property-svc/internal/property-view/projections/postgres-projection/property_rules_postgres.go similarity index 99% rename from services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres.go rename to services/property-svc/internal/property-view/projections/postgres-projection/property_rules_postgres.go index ff5a434dd..3bb6792b6 100644 --- a/services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres.go +++ b/services/property-svc/internal/property-view/projections/postgres-projection/property_rules_postgres.go @@ -1,4 +1,4 @@ -package property_rules_postgres +package postgresprojection import ( "context" diff --git a/services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres_test.go b/services/property-svc/internal/property-view/projections/postgres-projection/property_rules_postgres_test.go similarity index 99% rename from services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres_test.go rename to services/property-svc/internal/property-view/projections/postgres-projection/property_rules_postgres_test.go index 74ffde3ea..9b743a7c3 100644 --- a/services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres_test.go +++ b/services/property-svc/internal/property-view/projections/postgres-projection/property_rules_postgres_test.go @@ -1,4 +1,4 @@ -package property_rules_postgres +package postgresprojection import ( "bytes" diff --git a/services/property-svc/internal/property/projections/postgres_projection/postgres_projection.go b/services/property-svc/internal/property/projections/postgres-projection/postgres_projection.go similarity index 99% rename from services/property-svc/internal/property/projections/postgres_projection/postgres_projection.go rename to services/property-svc/internal/property/projections/postgres-projection/postgres_projection.go index 1ffe09d3a..6487a5cc4 100644 --- a/services/property-svc/internal/property/projections/postgres_projection/postgres_projection.go +++ b/services/property-svc/internal/property/projections/postgres-projection/postgres_projection.go @@ -1,4 +1,4 @@ -package postgres_projection +package postgresprojection import ( "context" diff --git a/services/property-svc/internal/property/projections/spiceDBProjection/property_spicedb_projection.go b/services/property-svc/internal/property/projections/spicedb-projection/property_spicedb_projection.go similarity index 98% rename from services/property-svc/internal/property/projections/spiceDBProjection/property_spicedb_projection.go rename to services/property-svc/internal/property/projections/spicedb-projection/property_spicedb_projection.go index c6b7928f8..b2a53edc7 100644 --- a/services/property-svc/internal/property/projections/spiceDBProjection/property_spicedb_projection.go +++ b/services/property-svc/internal/property/projections/spicedb-projection/property_spicedb_projection.go @@ -1,4 +1,4 @@ -package spiceDBProjection +package spicedbprojection import ( "context" diff --git a/services/tasks-svc/cmd/service/main.go b/services/tasks-svc/cmd/service/main.go index 8fd6f145b..c181c1827 100644 --- a/services/tasks-svc/cmd/service/main.go +++ b/services/tasks-svc/cmd/service/main.go @@ -10,13 +10,12 @@ import ( "hwes/eventstoredb/projections" "time" - "tasks-svc/internal/patient/projections/patientSpiceDBProjection" - ph "tasks-svc/internal/patient/handlers" - "tasks-svc/internal/patient/projections/patientPostgresProjection" + patientPostgresProjection "tasks-svc/internal/patient/projections/postgres-projection" + patientSpiceDBProjection "tasks-svc/internal/patient/projections/spicedb-projection" th "tasks-svc/internal/task/handlers" - "tasks-svc/internal/task/projections/task_postgres_projection" - "tasks-svc/internal/task/projections/task_spicedb" + taskPostgresProjection "tasks-svc/internal/task/projections/postgres-projection" + taskSpiceDBProjection "tasks-svc/internal/task/projections/spicedb-projection" "tasks-svc/internal/tracking" daprd "github.com/dapr/go-sdk/service/grpc" @@ -49,8 +48,8 @@ func Main(version string, ready func()) { go projections.StartProjections( ctx, common.Shutdown, - task_spicedb.NewSpiceDBProjection(eventStore, authz, ServiceName), - task_postgres_projection.NewProjection(eventStore, ServiceName), + taskSpiceDBProjection.NewSpiceDBProjection(eventStore, authz, ServiceName), + taskPostgresProjection.NewProjection(eventStore, ServiceName), patientPostgresProjection.NewProjection(eventStore, ServiceName), patientSpiceDBProjection.NewProjection(eventStore, authz, ServiceName), ) @@ -63,7 +62,7 @@ func Main(version string, ready func()) { pb.RegisterBedServiceServer(grpcServer, bed.NewServiceServer(authz, eventStore)) pb.RegisterRoomServiceServer(grpcServer, room.NewServiceServer(authz, eventStore)) pb.RegisterWardServiceServer(grpcServer, ward.NewServiceServer(authz, eventStore)) - pb.RegisterTaskTemplateServiceServer(grpcServer, task_template.NewServiceServer(authz, eventStore)) + pb.RegisterTaskTemplateServiceServer(grpcServer, tasktemplate.NewServiceServer(authz, eventStore)) if ready != nil { ready() diff --git a/services/tasks-svc/internal/patient/projections/patientPostgresProjection/patient_postgres_projection.go b/services/tasks-svc/internal/patient/projections/postgres-projection/patient_postgres_projection.go similarity index 99% rename from services/tasks-svc/internal/patient/projections/patientPostgresProjection/patient_postgres_projection.go rename to services/tasks-svc/internal/patient/projections/postgres-projection/patient_postgres_projection.go index 637d334a7..7a7068e90 100644 --- a/services/tasks-svc/internal/patient/projections/patientPostgresProjection/patient_postgres_projection.go +++ b/services/tasks-svc/internal/patient/projections/postgres-projection/patient_postgres_projection.go @@ -1,4 +1,4 @@ -package patientPostgresProjection +package postgresprojection import ( "context" diff --git a/services/tasks-svc/internal/patient/projections/patientSpiceDBProjection/patient_spicedb_projection.go b/services/tasks-svc/internal/patient/projections/spicedb-projection/patient_spicedb_projection.go similarity index 98% rename from services/tasks-svc/internal/patient/projections/patientSpiceDBProjection/patient_spicedb_projection.go rename to services/tasks-svc/internal/patient/projections/spicedb-projection/patient_spicedb_projection.go index 72e2cb087..59ebb158f 100644 --- a/services/tasks-svc/internal/patient/projections/patientSpiceDBProjection/patient_spicedb_projection.go +++ b/services/tasks-svc/internal/patient/projections/spicedb-projection/patient_spicedb_projection.go @@ -1,4 +1,4 @@ -package patientSpiceDBProjection +package spicedbprojection import ( "context" diff --git a/services/tasks-svc/internal/task-template/task_template.go b/services/tasks-svc/internal/task-template/task_template.go index 63d1cf5ee..34f74913d 100644 --- a/services/tasks-svc/internal/task-template/task_template.go +++ b/services/tasks-svc/internal/task-template/task_template.go @@ -1,4 +1,4 @@ -package task_template +package tasktemplate import ( "common" diff --git a/services/tasks-svc/internal/task/projections/task_postgres_projection/task_postgres_projection.go b/services/tasks-svc/internal/task/projections/postgres-projection/task_postgres_projection.go similarity index 99% rename from services/tasks-svc/internal/task/projections/task_postgres_projection/task_postgres_projection.go rename to services/tasks-svc/internal/task/projections/postgres-projection/task_postgres_projection.go index feb85eccb..1defe67fb 100644 --- a/services/tasks-svc/internal/task/projections/task_postgres_projection/task_postgres_projection.go +++ b/services/tasks-svc/internal/task/projections/postgres-projection/task_postgres_projection.go @@ -1,4 +1,4 @@ -package task_postgres_projection +package postgresprojection import ( "common/hwerr" diff --git a/services/tasks-svc/internal/task/projections/task_spicedb/spicedb.go b/services/tasks-svc/internal/task/projections/spicedb-projection/spicedb.go similarity index 98% rename from services/tasks-svc/internal/task/projections/task_spicedb/spicedb.go rename to services/tasks-svc/internal/task/projections/spicedb-projection/spicedb.go index 7f6ec460d..98500bd98 100644 --- a/services/tasks-svc/internal/task/projections/task_spicedb/spicedb.go +++ b/services/tasks-svc/internal/task/projections/spicedb-projection/spicedb.go @@ -1,4 +1,4 @@ -package task_spicedb +package spicedbprojection import ( "context"