From d500e3802fc9f58a074d55be43095a9ac90f23b2 Mon Sep 17 00:00:00 2001 From: joshsiv-mulga Date: Wed, 7 Oct 2026 14:23:04 +1000 Subject: [PATCH] refactor: move EC2 capacityreservation action adapters to domains/ec2/awsapi --- .../capacityreservation/CancelCapacityReservation.go | 2 +- .../capacityreservation/CreateCapacityReservation.go | 2 +- .../capacityreservation/DescribeCapacityReservations.go | 2 +- .../capacityreservation/capacityreservation_test.go | 2 +- .../ec2/awsapi}/capacityreservation/fanout.go | 2 +- .../ec2/awsapi}/capacityreservation/fanout_test.go | 2 +- spinifex/gateway/ec2.go | 8 ++++---- 7 files changed, 10 insertions(+), 10 deletions(-) rename spinifex/{gateway/ec2 => domains/ec2/awsapi}/capacityreservation/CancelCapacityReservation.go (97%) rename spinifex/{gateway/ec2 => domains/ec2/awsapi}/capacityreservation/CreateCapacityReservation.go (98%) rename spinifex/{gateway/ec2 => domains/ec2/awsapi}/capacityreservation/DescribeCapacityReservations.go (99%) rename spinifex/{gateway/ec2 => domains/ec2/awsapi}/capacityreservation/capacityreservation_test.go (99%) rename spinifex/{gateway/ec2 => domains/ec2/awsapi}/capacityreservation/fanout.go (98%) rename spinifex/{gateway/ec2 => domains/ec2/awsapi}/capacityreservation/fanout_test.go (99%) diff --git a/spinifex/gateway/ec2/capacityreservation/CancelCapacityReservation.go b/spinifex/domains/ec2/awsapi/capacityreservation/CancelCapacityReservation.go similarity index 97% rename from spinifex/gateway/ec2/capacityreservation/CancelCapacityReservation.go rename to spinifex/domains/ec2/awsapi/capacityreservation/CancelCapacityReservation.go index 59444859c..82c7fa29e 100644 --- a/spinifex/gateway/ec2/capacityreservation/CancelCapacityReservation.go +++ b/spinifex/domains/ec2/awsapi/capacityreservation/CancelCapacityReservation.go @@ -1,4 +1,4 @@ -package gateway_ec2_capacityreservation +package capacityreservation import ( "context" diff --git a/spinifex/gateway/ec2/capacityreservation/CreateCapacityReservation.go b/spinifex/domains/ec2/awsapi/capacityreservation/CreateCapacityReservation.go similarity index 98% rename from spinifex/gateway/ec2/capacityreservation/CreateCapacityReservation.go rename to spinifex/domains/ec2/awsapi/capacityreservation/CreateCapacityReservation.go index f75947219..cc6652007 100644 --- a/spinifex/gateway/ec2/capacityreservation/CreateCapacityReservation.go +++ b/spinifex/domains/ec2/awsapi/capacityreservation/CreateCapacityReservation.go @@ -1,4 +1,4 @@ -package gateway_ec2_capacityreservation +package capacityreservation import ( "context" diff --git a/spinifex/gateway/ec2/capacityreservation/DescribeCapacityReservations.go b/spinifex/domains/ec2/awsapi/capacityreservation/DescribeCapacityReservations.go similarity index 99% rename from spinifex/gateway/ec2/capacityreservation/DescribeCapacityReservations.go rename to spinifex/domains/ec2/awsapi/capacityreservation/DescribeCapacityReservations.go index ab8d17925..c132ca03c 100644 --- a/spinifex/gateway/ec2/capacityreservation/DescribeCapacityReservations.go +++ b/spinifex/domains/ec2/awsapi/capacityreservation/DescribeCapacityReservations.go @@ -1,4 +1,4 @@ -package gateway_ec2_capacityreservation +package capacityreservation import ( "context" diff --git a/spinifex/gateway/ec2/capacityreservation/capacityreservation_test.go b/spinifex/domains/ec2/awsapi/capacityreservation/capacityreservation_test.go similarity index 99% rename from spinifex/gateway/ec2/capacityreservation/capacityreservation_test.go rename to spinifex/domains/ec2/awsapi/capacityreservation/capacityreservation_test.go index 8e314dbec..2a492d06c 100644 --- a/spinifex/gateway/ec2/capacityreservation/capacityreservation_test.go +++ b/spinifex/domains/ec2/awsapi/capacityreservation/capacityreservation_test.go @@ -1,4 +1,4 @@ -package gateway_ec2_capacityreservation +package capacityreservation import ( "context" diff --git a/spinifex/gateway/ec2/capacityreservation/fanout.go b/spinifex/domains/ec2/awsapi/capacityreservation/fanout.go similarity index 98% rename from spinifex/gateway/ec2/capacityreservation/fanout.go rename to spinifex/domains/ec2/awsapi/capacityreservation/fanout.go index c4c515304..d5f5855a8 100644 --- a/spinifex/gateway/ec2/capacityreservation/fanout.go +++ b/spinifex/domains/ec2/awsapi/capacityreservation/fanout.go @@ -1,4 +1,4 @@ -package gateway_ec2_capacityreservation +package capacityreservation import ( "context" diff --git a/spinifex/gateway/ec2/capacityreservation/fanout_test.go b/spinifex/domains/ec2/awsapi/capacityreservation/fanout_test.go similarity index 99% rename from spinifex/gateway/ec2/capacityreservation/fanout_test.go rename to spinifex/domains/ec2/awsapi/capacityreservation/fanout_test.go index 911f6abb6..86e2f56f8 100644 --- a/spinifex/gateway/ec2/capacityreservation/fanout_test.go +++ b/spinifex/domains/ec2/awsapi/capacityreservation/fanout_test.go @@ -1,4 +1,4 @@ -package gateway_ec2_capacityreservation +package capacityreservation import ( "context" diff --git a/spinifex/gateway/ec2.go b/spinifex/gateway/ec2.go index 29d4a66b8..6c9447b73 100644 --- a/spinifex/gateway/ec2.go +++ b/spinifex/gateway/ec2.go @@ -14,11 +14,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" ec2accountapi "github.com/mulgadc/spinifex/spinifex/domains/ec2/awsapi/account" + ec2capacityreservationapi "github.com/mulgadc/spinifex/spinifex/domains/ec2/awsapi/capacityreservation" "github.com/mulgadc/spinifex/spinifex/foundation/aws/errors" awsxml "github.com/mulgadc/spinifex/spinifex/foundation/aws/xml" "github.com/mulgadc/spinifex/spinifex/foundation/lifecycle/idempotency" gateway_ec2 "github.com/mulgadc/spinifex/spinifex/gateway/ec2" - gateway_ec2_capacityreservation "github.com/mulgadc/spinifex/spinifex/gateway/ec2/capacityreservation" gateway_ec2_eigw "github.com/mulgadc/spinifex/spinifex/gateway/ec2/eigw" gateway_ec2_eip "github.com/mulgadc/spinifex/spinifex/gateway/ec2/eip" gateway_ec2_igw "github.com/mulgadc/spinifex/spinifex/gateway/ec2/igw" @@ -443,13 +443,13 @@ var ec2Actions = map[string]ec2Action{ return gateway_ec2_placementgroup.DescribePlacementGroups(ctx, input, gw.NATSConn, accountID) }), "CreateCapacityReservation": ec2IdempotentHandler(func(ctx context.Context, input *ec2.CreateCapacityReservationInput, gw *GatewayConfig, accountID string) (ec2.CreateCapacityReservationOutput, error) { - return gateway_ec2_capacityreservation.CreateCapacityReservation(ctx, input, gw.NATSConn, gw.ExpectedNodes, accountID) + return ec2capacityreservationapi.CreateCapacityReservation(ctx, input, gw.NATSConn, gw.ExpectedNodes, accountID) }), "DescribeCapacityReservations": ec2Handler(func(ctx context.Context, input *ec2.DescribeCapacityReservationsInput, gw *GatewayConfig, accountID string) (any, error) { - return gateway_ec2_capacityreservation.DescribeCapacityReservations(ctx, input, gw.NATSConn, gw.ExpectedNodes, accountID) + return ec2capacityreservationapi.DescribeCapacityReservations(ctx, input, gw.NATSConn, gw.ExpectedNodes, accountID) }), "CancelCapacityReservation": ec2Handler(func(ctx context.Context, input *ec2.CancelCapacityReservationInput, gw *GatewayConfig, accountID string) (any, error) { - return gateway_ec2_capacityreservation.CancelCapacityReservation(ctx, input, gw.NATSConn, gw.ExpectedNodes, accountID) + return ec2capacityreservationapi.CancelCapacityReservation(ctx, input, gw.NATSConn, gw.ExpectedNodes, accountID) }), "CreateLaunchTemplate": ec2Handler(func(ctx context.Context, input *ec2.CreateLaunchTemplateInput, gw *GatewayConfig, accountID string) (any, error) { return gateway_ec2_launchtemplate.CreateLaunchTemplate(ctx, input, gw.NATSConn, accountID)