From a233cab507aa9a3cc9bf6004fa4d1066025cae76 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 02:45:04 +0530 Subject: [PATCH 01/15] docs: add repository structure & naming convention (#325) --- docs/STRUCTURE.md | 183 ++++++++++++++++++ providers/aws/{awsiam => iam}/iam.go | 0 providers/aws/{awsiam => iam}/iam_test.go | 0 .../aws/{awsiam => iam}/managedpolicy.go | 0 .../aws/{awsiam => iam}/managedpolicy_test.go | 0 providers/aws/{awsiam => iam}/rolepolicy.go | 0 providers/aws/{awsiam => iam}/roletags.go | 0 providers/azure/{azureai => ai}/azureai.go | 0 .../{azureai => ai}/cognitiveservices.go | 0 providers/azure/{azureai => ai}/dataplane.go | 0 .../azure/{azureai => ai}/machinelearning.go | 0 .../{azureai => ai}/machinelearning_more.go | 0 .../azure/{azurecache => cache}/azurecache.go | 0 .../{azurecache => cache}/azurecache_test.go | 0 .../{azurecache => cache}/ordering_test.go | 0 providers/azure/{azuredns => dns}/dns.go | 0 providers/azure/{azuredns => dns}/dns_test.go | 0 .../azure/{azuredns => dns}/healthcheck.go | 0 .../azure/{azuredns => dns}/ordering_test.go | 0 providers/azure/{azureiam => iam}/iam.go | 0 providers/azure/{azureiam => iam}/iam_test.go | 0 .../azure/{azurelb => loadbalancer}/lb.go | 0 .../{azurelb => loadbalancer}/lb_test.go | 0 .../{azuremonitor => monitor}/monitor.go | 0 .../{azuremonitor => monitor}/monitor_test.go | 0 .../{azuresearch => search}/azuresearch.go | 0 .../{azuresearch => search}/control_keys.go | 0 .../{azuresearch => search}/dataplane.go | 0 .../{azuresearch => search}/dataplane_more.go | 0 providers/azure/{azuresql => sql}/azuresql.go | 0 .../azure/{azuresql => sql}/azuresql_test.go | 0 .../azure/{azuresql => sql}/databases.go | 0 .../{azuresql => sql}/databases_cost_test.go | 0 .../{azuresql => sql}/managedinstance.go | 0 .../azure/{azuresql => sql}/subresources.go | 0 providers/gcp/{gcpiam => iam}/iam.go | 0 providers/gcp/{gcpiam => iam}/iam_test.go | 0 providers/gcp/{gcplb => loadbalancer}/lb.go | 0 .../gcp/{gcplb => loadbalancer}/lb_test.go | 0 providers/gcp/{gcpvpc => vpc}/acl.go | 0 providers/gcp/{gcpvpc => vpc}/eip.go | 0 providers/gcp/{gcpvpc => vpc}/endpoint.go | 0 providers/gcp/{gcpvpc => vpc}/flowlog.go | 0 providers/gcp/{gcpvpc => vpc}/igw.go | 0 providers/gcp/{gcpvpc => vpc}/natgw.go | 0 providers/gcp/{gcpvpc => vpc}/peering.go | 0 providers/gcp/{gcpvpc => vpc}/routetable.go | 0 providers/gcp/{gcpvpc => vpc}/rtassoc.go | 0 providers/gcp/{gcpvpc => vpc}/vpc.go | 0 providers/gcp/{gcpvpc => vpc}/vpc_test.go | 0 50 files changed, 183 insertions(+) create mode 100644 docs/STRUCTURE.md rename providers/aws/{awsiam => iam}/iam.go (100%) rename providers/aws/{awsiam => iam}/iam_test.go (100%) rename providers/aws/{awsiam => iam}/managedpolicy.go (100%) rename providers/aws/{awsiam => iam}/managedpolicy_test.go (100%) rename providers/aws/{awsiam => iam}/rolepolicy.go (100%) rename providers/aws/{awsiam => iam}/roletags.go (100%) rename providers/azure/{azureai => ai}/azureai.go (100%) rename providers/azure/{azureai => ai}/cognitiveservices.go (100%) rename providers/azure/{azureai => ai}/dataplane.go (100%) rename providers/azure/{azureai => ai}/machinelearning.go (100%) rename providers/azure/{azureai => ai}/machinelearning_more.go (100%) rename providers/azure/{azurecache => cache}/azurecache.go (100%) rename providers/azure/{azurecache => cache}/azurecache_test.go (100%) rename providers/azure/{azurecache => cache}/ordering_test.go (100%) rename providers/azure/{azuredns => dns}/dns.go (100%) rename providers/azure/{azuredns => dns}/dns_test.go (100%) rename providers/azure/{azuredns => dns}/healthcheck.go (100%) rename providers/azure/{azuredns => dns}/ordering_test.go (100%) rename providers/azure/{azureiam => iam}/iam.go (100%) rename providers/azure/{azureiam => iam}/iam_test.go (100%) rename providers/azure/{azurelb => loadbalancer}/lb.go (100%) rename providers/azure/{azurelb => loadbalancer}/lb_test.go (100%) rename providers/azure/{azuremonitor => monitor}/monitor.go (100%) rename providers/azure/{azuremonitor => monitor}/monitor_test.go (100%) rename providers/azure/{azuresearch => search}/azuresearch.go (100%) rename providers/azure/{azuresearch => search}/control_keys.go (100%) rename providers/azure/{azuresearch => search}/dataplane.go (100%) rename providers/azure/{azuresearch => search}/dataplane_more.go (100%) rename providers/azure/{azuresql => sql}/azuresql.go (100%) rename providers/azure/{azuresql => sql}/azuresql_test.go (100%) rename providers/azure/{azuresql => sql}/databases.go (100%) rename providers/azure/{azuresql => sql}/databases_cost_test.go (100%) rename providers/azure/{azuresql => sql}/managedinstance.go (100%) rename providers/azure/{azuresql => sql}/subresources.go (100%) rename providers/gcp/{gcpiam => iam}/iam.go (100%) rename providers/gcp/{gcpiam => iam}/iam_test.go (100%) rename providers/gcp/{gcplb => loadbalancer}/lb.go (100%) rename providers/gcp/{gcplb => loadbalancer}/lb_test.go (100%) rename providers/gcp/{gcpvpc => vpc}/acl.go (100%) rename providers/gcp/{gcpvpc => vpc}/eip.go (100%) rename providers/gcp/{gcpvpc => vpc}/endpoint.go (100%) rename providers/gcp/{gcpvpc => vpc}/flowlog.go (100%) rename providers/gcp/{gcpvpc => vpc}/igw.go (100%) rename providers/gcp/{gcpvpc => vpc}/natgw.go (100%) rename providers/gcp/{gcpvpc => vpc}/peering.go (100%) rename providers/gcp/{gcpvpc => vpc}/routetable.go (100%) rename providers/gcp/{gcpvpc => vpc}/rtassoc.go (100%) rename providers/gcp/{gcpvpc => vpc}/vpc.go (100%) rename providers/gcp/{gcpvpc => vpc}/vpc_test.go (100%) diff --git a/docs/STRUCTURE.md b/docs/STRUCTURE.md new file mode 100644 index 00000000..044a5002 --- /dev/null +++ b/docs/STRUCTURE.md @@ -0,0 +1,183 @@ +# Repository Structure & Naming Convention + +This is the **source of truth** for how code is named and laid out in cloudemu. It +exists so every service is named the same way in every layer, every file lands in a +predictable place, and a new service or feature has an obvious home. Read this before +adding a service, a resource, or a sub-surface. + +For the *why* of the three-layer design, see [architecture.md](architecture.md). This +document is only about **naming and placement**. + +--- + +## 1. The three layers + +Every service spans up to three layers, in three parallel trees: + +``` +services// # portable API + driver interface (cross-cloud abstraction) +providers/// # in-memory mock for one cloud +server/// # SDK-compat wire handler for one cloud +``` + +- `` is one of `aws`, `azure`, `gcp`. +- Not every service has all three layers — a product-specific mock (e.g. `bedrock`) + may have no cross-cloud `services/` abstraction, and some services have no wire + handler yet. That is fine; the naming rules below still apply to whichever layers exist. + +--- + +## 2. Naming (the rule) + +cloudemu is an **SDK-compat emulator**: pointing a real SDK/CLI at it should feel +natural. So provider and wire layers keep the name that cloud's own SDK uses, while +the shared abstraction uses a generic capability name. + +### 2.1 `services/` — generic capability name +The shared abstraction is named for the **capability**, never a product: +`storage`, `compute`, `networking`, `loadbalancer`, `iam`, `database`, +`relationaldb`, `dns`, `monitoring`, `logging`, `secrets`, `messagequeue`, +`eventbus`, `serverless`, `cache`, `containerregistry`, `notification`. + +Product-specific services with no cross-cloud abstraction keep their **product name** +consistently (`bedrock`, `vertexai`, `databricks`, `bigtable`, `ecs`, `sagemaker`, …). + +### 2.2 `providers//` and `server//` — real SDK name, no cloud prefix +The mock and wire layers use the **service's own short name as that cloud knows it**: + +| Capability | AWS | Azure | GCP | +|---|---|---|---| +| Storage | `s3` | `blobstorage` | `gcs` | +| Compute | `ec2` | `virtualmachines` | `gce` | +| Networking | `vpc` | `vnet` | `vpc` | +| IAM | `iam` | `iam` | `iam` | +| Load balancer | `elb` | `loadbalancer` | `loadbalancer` | +| Database (NoSQL) | `dynamodb` | `cosmosdb` | `firestore` | +| DNS | `route53` | `dns` | `clouddns` | +| Cache | `elasticache` | `cache` | `memorystore` | +| Monitoring | `cloudwatch` | `monitor` | `cloudmonitoring` | + +Two hard rules: + +- **No redundant cloud prefix.** The parent directory already encodes the cloud, so an + `aws`/`azure`/`gcp` prefix on the leaf is noise. Drop it: + `awsiam` → `iam`, `azurecache` → `cache`, `azuredns` → `dns`, `azureiam` → `iam`, + `azurelb` → `loadbalancer`, `azuremonitor` → `monitor`, `azuresql` → `sql`, + `azureai` → `ai`, `azuresearch` → `search`, `gcpiam` → `iam`, `gcplb` → `loadbalancer`, + `gcpvpc` → `vpc`. +- **Provider ↔ wire match within a cloud.** For a given cloud, the `providers//X` + and `server//X` directories share the **same** name `X`, so the two layers of a + service map by name (e.g. `providers/azure/blobstorage` ↔ `server/azure/blobstorage`). + +> Names are **not** forced to be identical *across* clouds at the provider/wire layer — +> `s3` / `blobstorage` / `gcs` are each faithful to their own SDK, which is the point. +> Cross-cloud unification lives in the `services/` name only. + +--- + +## 3. File naming (the rule) + +- **`snake_case`, full words, no abbreviations** — in *every* layer. + `natgw.go` → `nat_gateway.go`, `eip.go` → `elastic_ip.go`, `eni.go` → `network_interface.go`, + `igw.go` → `internet_gateway.go`, `trafficmirror.go` → `traffic_mirror.go`. +- **A feature uses the same filename across all three layers**, so one `grep` (or one + filename) finds the interface, the mock, and the wire handler for a feature. + +| Feature | ✅ filename (all layers) | +|---|---| +| NAT gateway | `nat_gateway.go` | +| Internet gateway | `internet_gateway.go` | +| Elastic IP / public IP | `elastic_ip.go` | +| Network interface | `network_interface.go` | +| Traffic mirroring | `traffic_mirror.go` | + +Test files sit next to what they test: `_test.go`. + +--- + +## 4. Per-directory layout (the template) + +### `services//` +``` +driver/driver.go # the driver interface(s) — always in a driver/ subpackage +.go # portable API + do()/pipeline wiring +_test.go +.go # optional: one file per portable-API feature area +``` + +### `providers///` +``` +.go # store + core CRUD +_test.go +.go # one file per feature (same filename as the wire layer's) +clone.go # optional: copy-on-write helpers +tags.go # optional: tagging, if the service is tagged +``` + +### `server///` +``` +handler.go # routing / dispatch (Matches + ServeHTTP) +types.go # wire DTOs + mapping to/from the driver +.go # one wire file per feature (same filename as the provider's) +``` + +### The `driver/` subpackage rule +Every **portable-API service** in `services/` puts its interface in a `driver/` +subpackage. Documented exceptions — these are *not* portable-API services and correctly +have no `driver/`: + +- `services/kubernetes` — a self-contained data-plane engine (its own HTTP surface). +- `services/resourcediscovery` — a cross-service engine that *consumes* other drivers. +- `services/cost`, `services/scope` — cross-cutting utilities, not a cloud capability. + +If you add a genuine portable-API service, it **must** have `driver/`. + +--- + +## 5. Sub-surfaces → same-named subdirectories + +When a service grows a large or self-contained sub-surface, promote it to a +**same-named subdirectory in each layer** instead of a pile of flat files: + +``` +services/networking/traffic_mirror/ # interface fragment +providers/aws/networking/traffic_mirror/ # mock +server/aws/networking/traffic_mirror/ # wire +``` + +**Rule of thumb:** a sub-surface with **more than ~5 files** or a self-contained +sub-API earns its own same-named subdirectory across the layers it touches. Smaller +sub-surfaces stay as flat `.go` files. Either way the filename/dirname is the +same in every layer, so a feature always has one home. + +--- + +## 6. Adding to the codebase — where things go + +**A new resource on an existing service:** add `.go` (same filename) to the +provider mock, the wire handler, and — if it crosses the portable API — the `driver/` +interface + `services/` wrapper. Add `_test.go` beside each. + +**A new service:** create `services//driver/driver.go` + +`services//.go`, then `providers///` and +`server///` for each cloud you implement, all following §2–§4. Wire it +into the provider factory (`providers//.go`) and `SetMonitoring()` if it +emits metrics. + +--- + +## 7. Migration policy (for existing drift) + +The rules above are the target. Existing code that predates them is aligned +**incrementally, never in a big bang**: + +- **One service per PR.** A rename is a mechanical `git mv` + import fixups + factory + rename, with **no behavior change** in that PR. +- Start with the clearest wins (drop the cloud prefixes in §2.2; the `snake_case` + filename fixes in §3). +- Keep each PR small so it rebases cleanly against in-flight feature work — the factory + and wire files are edited by almost every branch, so a repo-wide rename would conflict + with everything. + +A CI check that fails on a new cloud-prefixed directory or a non-`snake_case` filename +keeps drift from creeping back once a service is migrated. diff --git a/providers/aws/awsiam/iam.go b/providers/aws/iam/iam.go similarity index 100% rename from providers/aws/awsiam/iam.go rename to providers/aws/iam/iam.go diff --git a/providers/aws/awsiam/iam_test.go b/providers/aws/iam/iam_test.go similarity index 100% rename from providers/aws/awsiam/iam_test.go rename to providers/aws/iam/iam_test.go diff --git a/providers/aws/awsiam/managedpolicy.go b/providers/aws/iam/managedpolicy.go similarity index 100% rename from providers/aws/awsiam/managedpolicy.go rename to providers/aws/iam/managedpolicy.go diff --git a/providers/aws/awsiam/managedpolicy_test.go b/providers/aws/iam/managedpolicy_test.go similarity index 100% rename from providers/aws/awsiam/managedpolicy_test.go rename to providers/aws/iam/managedpolicy_test.go diff --git a/providers/aws/awsiam/rolepolicy.go b/providers/aws/iam/rolepolicy.go similarity index 100% rename from providers/aws/awsiam/rolepolicy.go rename to providers/aws/iam/rolepolicy.go diff --git a/providers/aws/awsiam/roletags.go b/providers/aws/iam/roletags.go similarity index 100% rename from providers/aws/awsiam/roletags.go rename to providers/aws/iam/roletags.go diff --git a/providers/azure/azureai/azureai.go b/providers/azure/ai/azureai.go similarity index 100% rename from providers/azure/azureai/azureai.go rename to providers/azure/ai/azureai.go diff --git a/providers/azure/azureai/cognitiveservices.go b/providers/azure/ai/cognitiveservices.go similarity index 100% rename from providers/azure/azureai/cognitiveservices.go rename to providers/azure/ai/cognitiveservices.go diff --git a/providers/azure/azureai/dataplane.go b/providers/azure/ai/dataplane.go similarity index 100% rename from providers/azure/azureai/dataplane.go rename to providers/azure/ai/dataplane.go diff --git a/providers/azure/azureai/machinelearning.go b/providers/azure/ai/machinelearning.go similarity index 100% rename from providers/azure/azureai/machinelearning.go rename to providers/azure/ai/machinelearning.go diff --git a/providers/azure/azureai/machinelearning_more.go b/providers/azure/ai/machinelearning_more.go similarity index 100% rename from providers/azure/azureai/machinelearning_more.go rename to providers/azure/ai/machinelearning_more.go diff --git a/providers/azure/azurecache/azurecache.go b/providers/azure/cache/azurecache.go similarity index 100% rename from providers/azure/azurecache/azurecache.go rename to providers/azure/cache/azurecache.go diff --git a/providers/azure/azurecache/azurecache_test.go b/providers/azure/cache/azurecache_test.go similarity index 100% rename from providers/azure/azurecache/azurecache_test.go rename to providers/azure/cache/azurecache_test.go diff --git a/providers/azure/azurecache/ordering_test.go b/providers/azure/cache/ordering_test.go similarity index 100% rename from providers/azure/azurecache/ordering_test.go rename to providers/azure/cache/ordering_test.go diff --git a/providers/azure/azuredns/dns.go b/providers/azure/dns/dns.go similarity index 100% rename from providers/azure/azuredns/dns.go rename to providers/azure/dns/dns.go diff --git a/providers/azure/azuredns/dns_test.go b/providers/azure/dns/dns_test.go similarity index 100% rename from providers/azure/azuredns/dns_test.go rename to providers/azure/dns/dns_test.go diff --git a/providers/azure/azuredns/healthcheck.go b/providers/azure/dns/healthcheck.go similarity index 100% rename from providers/azure/azuredns/healthcheck.go rename to providers/azure/dns/healthcheck.go diff --git a/providers/azure/azuredns/ordering_test.go b/providers/azure/dns/ordering_test.go similarity index 100% rename from providers/azure/azuredns/ordering_test.go rename to providers/azure/dns/ordering_test.go diff --git a/providers/azure/azureiam/iam.go b/providers/azure/iam/iam.go similarity index 100% rename from providers/azure/azureiam/iam.go rename to providers/azure/iam/iam.go diff --git a/providers/azure/azureiam/iam_test.go b/providers/azure/iam/iam_test.go similarity index 100% rename from providers/azure/azureiam/iam_test.go rename to providers/azure/iam/iam_test.go diff --git a/providers/azure/azurelb/lb.go b/providers/azure/loadbalancer/lb.go similarity index 100% rename from providers/azure/azurelb/lb.go rename to providers/azure/loadbalancer/lb.go diff --git a/providers/azure/azurelb/lb_test.go b/providers/azure/loadbalancer/lb_test.go similarity index 100% rename from providers/azure/azurelb/lb_test.go rename to providers/azure/loadbalancer/lb_test.go diff --git a/providers/azure/azuremonitor/monitor.go b/providers/azure/monitor/monitor.go similarity index 100% rename from providers/azure/azuremonitor/monitor.go rename to providers/azure/monitor/monitor.go diff --git a/providers/azure/azuremonitor/monitor_test.go b/providers/azure/monitor/monitor_test.go similarity index 100% rename from providers/azure/azuremonitor/monitor_test.go rename to providers/azure/monitor/monitor_test.go diff --git a/providers/azure/azuresearch/azuresearch.go b/providers/azure/search/azuresearch.go similarity index 100% rename from providers/azure/azuresearch/azuresearch.go rename to providers/azure/search/azuresearch.go diff --git a/providers/azure/azuresearch/control_keys.go b/providers/azure/search/control_keys.go similarity index 100% rename from providers/azure/azuresearch/control_keys.go rename to providers/azure/search/control_keys.go diff --git a/providers/azure/azuresearch/dataplane.go b/providers/azure/search/dataplane.go similarity index 100% rename from providers/azure/azuresearch/dataplane.go rename to providers/azure/search/dataplane.go diff --git a/providers/azure/azuresearch/dataplane_more.go b/providers/azure/search/dataplane_more.go similarity index 100% rename from providers/azure/azuresearch/dataplane_more.go rename to providers/azure/search/dataplane_more.go diff --git a/providers/azure/azuresql/azuresql.go b/providers/azure/sql/azuresql.go similarity index 100% rename from providers/azure/azuresql/azuresql.go rename to providers/azure/sql/azuresql.go diff --git a/providers/azure/azuresql/azuresql_test.go b/providers/azure/sql/azuresql_test.go similarity index 100% rename from providers/azure/azuresql/azuresql_test.go rename to providers/azure/sql/azuresql_test.go diff --git a/providers/azure/azuresql/databases.go b/providers/azure/sql/databases.go similarity index 100% rename from providers/azure/azuresql/databases.go rename to providers/azure/sql/databases.go diff --git a/providers/azure/azuresql/databases_cost_test.go b/providers/azure/sql/databases_cost_test.go similarity index 100% rename from providers/azure/azuresql/databases_cost_test.go rename to providers/azure/sql/databases_cost_test.go diff --git a/providers/azure/azuresql/managedinstance.go b/providers/azure/sql/managedinstance.go similarity index 100% rename from providers/azure/azuresql/managedinstance.go rename to providers/azure/sql/managedinstance.go diff --git a/providers/azure/azuresql/subresources.go b/providers/azure/sql/subresources.go similarity index 100% rename from providers/azure/azuresql/subresources.go rename to providers/azure/sql/subresources.go diff --git a/providers/gcp/gcpiam/iam.go b/providers/gcp/iam/iam.go similarity index 100% rename from providers/gcp/gcpiam/iam.go rename to providers/gcp/iam/iam.go diff --git a/providers/gcp/gcpiam/iam_test.go b/providers/gcp/iam/iam_test.go similarity index 100% rename from providers/gcp/gcpiam/iam_test.go rename to providers/gcp/iam/iam_test.go diff --git a/providers/gcp/gcplb/lb.go b/providers/gcp/loadbalancer/lb.go similarity index 100% rename from providers/gcp/gcplb/lb.go rename to providers/gcp/loadbalancer/lb.go diff --git a/providers/gcp/gcplb/lb_test.go b/providers/gcp/loadbalancer/lb_test.go similarity index 100% rename from providers/gcp/gcplb/lb_test.go rename to providers/gcp/loadbalancer/lb_test.go diff --git a/providers/gcp/gcpvpc/acl.go b/providers/gcp/vpc/acl.go similarity index 100% rename from providers/gcp/gcpvpc/acl.go rename to providers/gcp/vpc/acl.go diff --git a/providers/gcp/gcpvpc/eip.go b/providers/gcp/vpc/eip.go similarity index 100% rename from providers/gcp/gcpvpc/eip.go rename to providers/gcp/vpc/eip.go diff --git a/providers/gcp/gcpvpc/endpoint.go b/providers/gcp/vpc/endpoint.go similarity index 100% rename from providers/gcp/gcpvpc/endpoint.go rename to providers/gcp/vpc/endpoint.go diff --git a/providers/gcp/gcpvpc/flowlog.go b/providers/gcp/vpc/flowlog.go similarity index 100% rename from providers/gcp/gcpvpc/flowlog.go rename to providers/gcp/vpc/flowlog.go diff --git a/providers/gcp/gcpvpc/igw.go b/providers/gcp/vpc/igw.go similarity index 100% rename from providers/gcp/gcpvpc/igw.go rename to providers/gcp/vpc/igw.go diff --git a/providers/gcp/gcpvpc/natgw.go b/providers/gcp/vpc/natgw.go similarity index 100% rename from providers/gcp/gcpvpc/natgw.go rename to providers/gcp/vpc/natgw.go diff --git a/providers/gcp/gcpvpc/peering.go b/providers/gcp/vpc/peering.go similarity index 100% rename from providers/gcp/gcpvpc/peering.go rename to providers/gcp/vpc/peering.go diff --git a/providers/gcp/gcpvpc/routetable.go b/providers/gcp/vpc/routetable.go similarity index 100% rename from providers/gcp/gcpvpc/routetable.go rename to providers/gcp/vpc/routetable.go diff --git a/providers/gcp/gcpvpc/rtassoc.go b/providers/gcp/vpc/rtassoc.go similarity index 100% rename from providers/gcp/gcpvpc/rtassoc.go rename to providers/gcp/vpc/rtassoc.go diff --git a/providers/gcp/gcpvpc/vpc.go b/providers/gcp/vpc/vpc.go similarity index 100% rename from providers/gcp/gcpvpc/vpc.go rename to providers/gcp/vpc/vpc.go diff --git a/providers/gcp/gcpvpc/vpc_test.go b/providers/gcp/vpc/vpc_test.go similarity index 100% rename from providers/gcp/gcpvpc/vpc_test.go rename to providers/gcp/vpc/vpc_test.go From 755765873a0d2e61b1c964a5c3ab37421c1fb2eb Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 02:45:04 +0530 Subject: [PATCH 02/15] refactor(providers): drop redundant cloud prefixes from provider dirs (#325) awsiam->iam; azure ai/cache/dns/iam/loadbalancer/monitor/search/sql; gcp iam/loadbalancer/vpc. Directory + package renames only; no behavior change. --- features/chaos/wrappers_azuresearch_test.go | 2 +- providers/aws/aws.go | 6 +- providers/aws/iam/iam.go | 4 +- providers/aws/iam/iam_test.go | 2 +- providers/aws/iam/managedpolicy.go | 2 +- providers/aws/iam/managedpolicy_test.go | 2 +- providers/aws/iam/rolepolicy.go | 2 +- providers/aws/iam/roletags.go | 2 +- providers/azure/ai/azureai.go | 4 +- providers/azure/ai/cognitiveservices.go | 2 +- providers/azure/ai/dataplane.go | 2 +- providers/azure/ai/machinelearning.go | 2 +- providers/azure/ai/machinelearning_more.go | 2 +- providers/azure/azure.go | 50 +++++------ providers/azure/cache/azurecache.go | 4 +- providers/azure/cache/azurecache_test.go | 2 +- providers/azure/cache/ordering_test.go | 2 +- providers/azure/dns/dns.go | 4 +- providers/azure/dns/dns_test.go | 2 +- providers/azure/dns/healthcheck.go | 2 +- providers/azure/dns/ordering_test.go | 2 +- providers/azure/iam/iam.go | 4 +- providers/azure/iam/iam_test.go | 2 +- providers/azure/loadbalancer/lb.go | 4 +- providers/azure/loadbalancer/lb_test.go | 2 +- providers/azure/monitor/monitor.go | 4 +- providers/azure/monitor/monitor_test.go | 2 +- providers/azure/search/azuresearch.go | 4 +- providers/azure/search/control_keys.go | 2 +- providers/azure/search/dataplane.go | 2 +- providers/azure/search/dataplane_more.go | 2 +- providers/azure/sql/azuresql.go | 4 +- providers/azure/sql/azuresql_test.go | 8 +- providers/azure/sql/databases.go | 2 +- providers/azure/sql/databases_cost_test.go | 2 +- providers/azure/sql/managedinstance.go | 2 +- providers/azure/sql/subresources.go | 2 +- providers/gcp/gcp.go | 18 ++-- providers/gcp/iam/iam.go | 4 +- providers/gcp/iam/iam_test.go | 2 +- providers/gcp/loadbalancer/lb.go | 4 +- providers/gcp/loadbalancer/lb_test.go | 2 +- providers/gcp/vpc/acl.go | 2 +- providers/gcp/vpc/eip.go | 2 +- providers/gcp/vpc/endpoint.go | 2 +- providers/gcp/vpc/flowlog.go | 2 +- providers/gcp/vpc/igw.go | 2 +- providers/gcp/vpc/natgw.go | 2 +- providers/gcp/vpc/peering.go | 2 +- providers/gcp/vpc/routetable.go | 2 +- providers/gcp/vpc/rtassoc.go | 2 +- providers/gcp/vpc/vpc.go | 4 +- providers/gcp/vpc/vpc_test.go | 2 +- server/aws/iam/errors_sdk_test.go | 14 +-- server/aws/iam/sdk_roundtrip_test.go | 98 ++++++++++----------- services/azureai/azureai_test.go | 2 +- services/azuresearch/azuresearch_test.go | 2 +- 57 files changed, 160 insertions(+), 160 deletions(-) diff --git a/features/chaos/wrappers_azuresearch_test.go b/features/chaos/wrappers_azuresearch_test.go index 2885915b..67046fa2 100644 --- a/features/chaos/wrappers_azuresearch_test.go +++ b/features/chaos/wrappers_azuresearch_test.go @@ -7,7 +7,7 @@ import ( "github.com/stackshy/cloudemu/v2/config" "github.com/stackshy/cloudemu/v2/features/chaos" - provsearch "github.com/stackshy/cloudemu/v2/providers/azure/azuresearch" + provsearch "github.com/stackshy/cloudemu/v2/providers/azure/search" "github.com/stackshy/cloudemu/v2/services/azuresearch/driver" ) diff --git a/providers/aws/aws.go b/providers/aws/aws.go index 8f2650fd..7c49e0a2 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -7,7 +7,7 @@ import ( "github.com/stackshy/cloudemu/v2/config" cerrors "github.com/stackshy/cloudemu/v2/errors" - "github.com/stackshy/cloudemu/v2/providers/aws/awsiam" + "github.com/stackshy/cloudemu/v2/providers/aws/iam" "github.com/stackshy/cloudemu/v2/providers/aws/bedrock" "github.com/stackshy/cloudemu/v2/providers/aws/bedrockagent" "github.com/stackshy/cloudemu/v2/providers/aws/bedrockagentruntime" @@ -122,7 +122,7 @@ type Provider struct { Lambda *lambda.Mock VPC *vpc.Mock CloudWatch *cloudwatch.Mock - IAM *awsiam.Mock + IAM *iam.Mock Route53 *route53.Mock ELB *elb.Mock SQS *sqs.Mock @@ -159,7 +159,7 @@ func New(opts ...config.Option) *Provider { Lambda: lambda.New(o), VPC: vpc.New(o), CloudWatch: cloudwatch.New(o), - IAM: awsiam.New(o), + IAM: iam.New(o), Route53: route53.New(o), ELB: elb.New(o), SQS: sqs.New(o), diff --git a/providers/aws/iam/iam.go b/providers/aws/iam/iam.go index da0853cb..52c11b88 100644 --- a/providers/aws/iam/iam.go +++ b/providers/aws/iam/iam.go @@ -1,5 +1,5 @@ -// Package awsiam provides an in-memory mock implementation of AWS IAM. -package awsiam +// Package iam provides an in-memory mock implementation of AWS IAM. +package iam import ( "context" diff --git a/providers/aws/iam/iam_test.go b/providers/aws/iam/iam_test.go index 9fad4004..f57a5f0d 100644 --- a/providers/aws/iam/iam_test.go +++ b/providers/aws/iam/iam_test.go @@ -1,4 +1,4 @@ -package awsiam +package iam import ( "context" diff --git a/providers/aws/iam/managedpolicy.go b/providers/aws/iam/managedpolicy.go index 892be045..dc26a94d 100644 --- a/providers/aws/iam/managedpolicy.go +++ b/providers/aws/iam/managedpolicy.go @@ -1,4 +1,4 @@ -package awsiam +package iam import ( "strings" diff --git a/providers/aws/iam/managedpolicy_test.go b/providers/aws/iam/managedpolicy_test.go index 079ebbd0..9952dc87 100644 --- a/providers/aws/iam/managedpolicy_test.go +++ b/providers/aws/iam/managedpolicy_test.go @@ -1,4 +1,4 @@ -package awsiam +package iam import ( "context" diff --git a/providers/aws/iam/rolepolicy.go b/providers/aws/iam/rolepolicy.go index f7704836..c04359b7 100644 --- a/providers/aws/iam/rolepolicy.go +++ b/providers/aws/iam/rolepolicy.go @@ -1,4 +1,4 @@ -package awsiam +package iam import ( "context" diff --git a/providers/aws/iam/roletags.go b/providers/aws/iam/roletags.go index ab079dba..6cd39dbb 100644 --- a/providers/aws/iam/roletags.go +++ b/providers/aws/iam/roletags.go @@ -1,4 +1,4 @@ -package awsiam +package iam import ( "context" diff --git a/providers/azure/ai/azureai.go b/providers/azure/ai/azureai.go index 7012c3ef..4b619940 100644 --- a/providers/azure/ai/azureai.go +++ b/providers/azure/ai/azureai.go @@ -1,9 +1,9 @@ -// Package azureai provides an in-memory mock implementation of Azure AI across +// Package ai provides an in-memory mock implementation of Azure AI across // both ARM providers — Microsoft.CognitiveServices (AI Foundry / AI Studio / // the AI Services resource / Azure OpenAI) and Microsoft.MachineLearningServices // (Azure Machine Learning) — plus the Azure OpenAI inference, AI Foundry // Agents/Assistants, and AML scoring data planes. -package azureai +package ai import ( "context" diff --git a/providers/azure/ai/cognitiveservices.go b/providers/azure/ai/cognitiveservices.go index 7d0d5c0c..484c7ed2 100644 --- a/providers/azure/ai/cognitiveservices.go +++ b/providers/azure/ai/cognitiveservices.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "context" diff --git a/providers/azure/ai/dataplane.go b/providers/azure/ai/dataplane.go index be8f8193..3c43c44c 100644 --- a/providers/azure/ai/dataplane.go +++ b/providers/azure/ai/dataplane.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "context" diff --git a/providers/azure/ai/machinelearning.go b/providers/azure/ai/machinelearning.go index 694686d8..fcc94502 100644 --- a/providers/azure/ai/machinelearning.go +++ b/providers/azure/ai/machinelearning.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "context" diff --git a/providers/azure/ai/machinelearning_more.go b/providers/azure/ai/machinelearning_more.go index f945aebb..20d08a70 100644 --- a/providers/azure/ai/machinelearning_more.go +++ b/providers/azure/ai/machinelearning_more.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "context" diff --git a/providers/azure/azure.go b/providers/azure/azure.go index 2ced046d..c7e86902 100644 --- a/providers/azure/azure.go +++ b/providers/azure/azure.go @@ -8,14 +8,14 @@ import ( "github.com/stackshy/cloudemu/v2/config" "github.com/stackshy/cloudemu/v2/providers/azure/acr" "github.com/stackshy/cloudemu/v2/providers/azure/aks" - "github.com/stackshy/cloudemu/v2/providers/azure/azureai" - "github.com/stackshy/cloudemu/v2/providers/azure/azurecache" - "github.com/stackshy/cloudemu/v2/providers/azure/azuredns" - "github.com/stackshy/cloudemu/v2/providers/azure/azureiam" - "github.com/stackshy/cloudemu/v2/providers/azure/azurelb" - "github.com/stackshy/cloudemu/v2/providers/azure/azuremonitor" - "github.com/stackshy/cloudemu/v2/providers/azure/azuresearch" - "github.com/stackshy/cloudemu/v2/providers/azure/azuresql" + "github.com/stackshy/cloudemu/v2/providers/azure/ai" + "github.com/stackshy/cloudemu/v2/providers/azure/cache" + "github.com/stackshy/cloudemu/v2/providers/azure/dns" + "github.com/stackshy/cloudemu/v2/providers/azure/iam" + "github.com/stackshy/cloudemu/v2/providers/azure/loadbalancer" + "github.com/stackshy/cloudemu/v2/providers/azure/monitor" + "github.com/stackshy/cloudemu/v2/providers/azure/search" + "github.com/stackshy/cloudemu/v2/providers/azure/sql" "github.com/stackshy/cloudemu/v2/providers/azure/blobstorage" "github.com/stackshy/cloudemu/v2/providers/azure/cosmosdb" "github.com/stackshy/cloudemu/v2/providers/azure/cosmospostgresql" @@ -122,10 +122,10 @@ type Provider struct { CosmosPostgreSQL *cosmospostgresql.Mock Functions *functions.Mock VNet *vnet.Mock - Monitor *azuremonitor.Mock - IAM *azureiam.Mock - DNS *azuredns.Mock - LB *azurelb.Mock + Monitor *monitor.Mock + IAM *iam.Mock + DNS *dns.Mock + LB *loadbalancer.Mock ServiceBus *servicebus.Mock // QueueStorage backs the Azure Queue Storage data-plane handler. It reuses // the messagequeue provider, but is a distinct instance from ServiceBus so @@ -133,19 +133,19 @@ type Provider struct { QueueStorage *servicebus.Mock // TableStorage backs the Azure Table Storage data-plane handler. TableStorage *tablestorage.Mock - Cache *azurecache.Mock + Cache *cache.Mock KeyVault *keyvault.Mock LogAnalytics *loganalytics.Mock NotificationHubs *notificationhubs.Mock ACR *acr.Mock EventGrid *eventgrid.Mock - SQL *azuresql.Mock + SQL *sql.Mock PostgresFlex *postgresflex.Mock MySQLFlex *mysqlflex.Mock AKS *aks.Mock Databricks *databricks.Mock - AzureAI *azureai.Mock - AzureSearch *azuresearch.Mock + AzureAI *ai.Mock + AzureSearch *search.Mock ResourceDiscovery *resourcediscovery.Engine @@ -168,26 +168,26 @@ func New(opts ...config.Option) *Provider { CosmosPostgreSQL: cosmospostgresql.New(o), Functions: functions.New(o), VNet: vnet.New(o), - Monitor: azuremonitor.New(o), - IAM: azureiam.New(o), - DNS: azuredns.New(o), - LB: azurelb.New(o), + Monitor: monitor.New(o), + IAM: iam.New(o), + DNS: dns.New(o), + LB: loadbalancer.New(o), ServiceBus: servicebus.New(o), QueueStorage: servicebus.New(o), TableStorage: tablestorage.New(o), - Cache: azurecache.New(o), + Cache: cache.New(o), KeyVault: keyvault.New(o), LogAnalytics: loganalytics.New(o), NotificationHubs: notificationhubs.New(o), ACR: acr.New(o), EventGrid: eventgrid.New(o), - SQL: azuresql.New(o), + SQL: sql.New(o), PostgresFlex: postgresflex.New(o), MySQLFlex: mysqlflex.New(o), AKS: aks.New(o), Databricks: databricks.New(o), - AzureAI: azureai.New(o), - AzureSearch: azuresearch.New(o), + AzureAI: ai.New(o), + AzureSearch: search.New(o), SubscriptionID: o.AccountID, Region: o.Region, } @@ -231,7 +231,7 @@ func New(opts ...config.Option) *Provider { // MySQL/PostgreSQL Flexible Servers) to the resourcediscovery // RelationalDatabases capability, so they surface in Resource Graph. type sqlDiscovery struct { - sql *azuresql.Mock + sql *sql.Mock mysql *mysqlflex.Mock pg *postgresflex.Mock } diff --git a/providers/azure/cache/azurecache.go b/providers/azure/cache/azurecache.go index 95073b85..20a50a7c 100644 --- a/providers/azure/cache/azurecache.go +++ b/providers/azure/cache/azurecache.go @@ -1,5 +1,5 @@ -// Package azurecache provides an in-memory mock implementation of Azure Cache for Redis. -package azurecache +// Package cache provides an in-memory mock implementation of Azure Cache for Redis. +package cache import ( "context" diff --git a/providers/azure/cache/azurecache_test.go b/providers/azure/cache/azurecache_test.go index 1d963f62..a39f6be2 100644 --- a/providers/azure/cache/azurecache_test.go +++ b/providers/azure/cache/azurecache_test.go @@ -1,4 +1,4 @@ -package azurecache +package cache import ( "context" diff --git a/providers/azure/cache/ordering_test.go b/providers/azure/cache/ordering_test.go index c6a57dd3..8e3fef30 100644 --- a/providers/azure/cache/ordering_test.go +++ b/providers/azure/cache/ordering_test.go @@ -1,4 +1,4 @@ -package azurecache +package cache import ( "context" diff --git a/providers/azure/dns/dns.go b/providers/azure/dns/dns.go index 63222e11..dd15056e 100644 --- a/providers/azure/dns/dns.go +++ b/providers/azure/dns/dns.go @@ -1,5 +1,5 @@ -// Package azuredns provides an in-memory mock implementation of Azure DNS. -package azuredns +// Package dns provides an in-memory mock implementation of Azure DNS. +package dns import ( "context" diff --git a/providers/azure/dns/dns_test.go b/providers/azure/dns/dns_test.go index 16999ed4..5fba0ae7 100644 --- a/providers/azure/dns/dns_test.go +++ b/providers/azure/dns/dns_test.go @@ -1,4 +1,4 @@ -package azuredns +package dns import ( "context" diff --git a/providers/azure/dns/healthcheck.go b/providers/azure/dns/healthcheck.go index bdf66efa..5b14bf6a 100644 --- a/providers/azure/dns/healthcheck.go +++ b/providers/azure/dns/healthcheck.go @@ -1,4 +1,4 @@ -package azuredns +package dns import ( "context" diff --git a/providers/azure/dns/ordering_test.go b/providers/azure/dns/ordering_test.go index 85663bba..678fff87 100644 --- a/providers/azure/dns/ordering_test.go +++ b/providers/azure/dns/ordering_test.go @@ -1,4 +1,4 @@ -package azuredns +package dns import ( "context" diff --git a/providers/azure/iam/iam.go b/providers/azure/iam/iam.go index 1dafde8c..805975e7 100644 --- a/providers/azure/iam/iam.go +++ b/providers/azure/iam/iam.go @@ -1,5 +1,5 @@ -// Package azureiam provides an in-memory mock implementation of Azure Active Directory / IAM. -package azureiam +// Package iam provides an in-memory mock implementation of Azure Active Directory / IAM. +package iam import ( "context" diff --git a/providers/azure/iam/iam_test.go b/providers/azure/iam/iam_test.go index e0c3a0ae..648109ee 100644 --- a/providers/azure/iam/iam_test.go +++ b/providers/azure/iam/iam_test.go @@ -1,4 +1,4 @@ -package azureiam +package iam import ( "context" diff --git a/providers/azure/loadbalancer/lb.go b/providers/azure/loadbalancer/lb.go index c257fe44..f251a0e4 100644 --- a/providers/azure/loadbalancer/lb.go +++ b/providers/azure/loadbalancer/lb.go @@ -1,5 +1,5 @@ -// Package azurelb provides an in-memory mock implementation of Azure Load Balancer. -package azurelb +// Package loadbalancer provides an in-memory mock implementation of Azure Load Balancer. +package loadbalancer import ( "context" diff --git a/providers/azure/loadbalancer/lb_test.go b/providers/azure/loadbalancer/lb_test.go index defc2f75..ceca4d20 100644 --- a/providers/azure/loadbalancer/lb_test.go +++ b/providers/azure/loadbalancer/lb_test.go @@ -1,4 +1,4 @@ -package azurelb +package loadbalancer import ( "context" diff --git a/providers/azure/monitor/monitor.go b/providers/azure/monitor/monitor.go index 493c9783..4887d131 100644 --- a/providers/azure/monitor/monitor.go +++ b/providers/azure/monitor/monitor.go @@ -1,5 +1,5 @@ -// Package azuremonitor provides an in-memory mock implementation of Azure Monitor. -package azuremonitor +// Package monitor provides an in-memory mock implementation of Azure Monitor. +package monitor import ( "context" diff --git a/providers/azure/monitor/monitor_test.go b/providers/azure/monitor/monitor_test.go index cd056373..62ecdd28 100644 --- a/providers/azure/monitor/monitor_test.go +++ b/providers/azure/monitor/monitor_test.go @@ -1,4 +1,4 @@ -package azuremonitor +package monitor import ( "context" diff --git a/providers/azure/search/azuresearch.go b/providers/azure/search/azuresearch.go index 610ee5af..9d136257 100644 --- a/providers/azure/search/azuresearch.go +++ b/providers/azure/search/azuresearch.go @@ -1,8 +1,8 @@ -// Package azuresearch provides an in-memory mock of Azure AI Search +// Package search provides an in-memory mock of Azure AI Search // (Microsoft.Search/searchServices) — the ARM control plane (service lifecycle, // admin/query keys, private links) and the search data plane (indexes, // documents, indexers, data sources, skillsets, synonym maps, aliases). -package azuresearch +package search import ( "context" diff --git a/providers/azure/search/control_keys.go b/providers/azure/search/control_keys.go index 89686ce5..99ce0406 100644 --- a/providers/azure/search/control_keys.go +++ b/providers/azure/search/control_keys.go @@ -1,4 +1,4 @@ -package azuresearch +package search import ( "context" diff --git a/providers/azure/search/dataplane.go b/providers/azure/search/dataplane.go index ead5e812..f980eb9e 100644 --- a/providers/azure/search/dataplane.go +++ b/providers/azure/search/dataplane.go @@ -1,4 +1,4 @@ -package azuresearch +package search import ( "context" diff --git a/providers/azure/search/dataplane_more.go b/providers/azure/search/dataplane_more.go index 9b3cf497..dffd7ad1 100644 --- a/providers/azure/search/dataplane_more.go +++ b/providers/azure/search/dataplane_more.go @@ -1,4 +1,4 @@ -package azuresearch +package search import ( "context" diff --git a/providers/azure/sql/azuresql.go b/providers/azure/sql/azuresql.go index 0d9239f7..1b2b5130 100644 --- a/providers/azure/sql/azuresql.go +++ b/providers/azure/sql/azuresql.go @@ -1,4 +1,4 @@ -// Package azuresql provides an in-memory mock of Microsoft.Sql (Azure SQL +// Package sql provides an in-memory mock of Microsoft.Sql (Azure SQL // Database). It implements relationaldb/driver.RelationalDB so the same // backend serves both the portable API (relationaldb.DB) and the SDK-compat // HTTP layer. @@ -19,7 +19,7 @@ // start/stop API. The mock still tracks state transitions so portable-API // users can drive Start/Stop and observe deterministic behavior; the // transitions don't affect the ARM-visible state. -package azuresql +package sql import ( "context" diff --git a/providers/azure/sql/azuresql_test.go b/providers/azure/sql/azuresql_test.go index 5dac686c..2ac669db 100644 --- a/providers/azure/sql/azuresql_test.go +++ b/providers/azure/sql/azuresql_test.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "context" @@ -8,7 +8,7 @@ import ( "time" "github.com/stackshy/cloudemu/v2/config" - "github.com/stackshy/cloudemu/v2/providers/azure/azuremonitor" + "github.com/stackshy/cloudemu/v2/providers/azure/monitor" rdsdriver "github.com/stackshy/cloudemu/v2/services/relationaldb/driver" ) @@ -369,7 +369,7 @@ func TestElasticPoolEmitsMetrics(t *testing.T) { opts := config.NewOptions(config.WithClock(fc), config.WithRegion("eastus")) m := New(opts) - mon := azuremonitor.New(opts) + mon := monitor.New(opts) m.SetMonitoring(mon) ctx := context.Background() @@ -786,7 +786,7 @@ func TestDatabaseAndManagedInstanceEmitMetrics(t *testing.T) { opts := config.NewOptions(config.WithClock(fc), config.WithRegion("eastus")) m := New(opts) - mon := azuremonitor.New(opts) + mon := monitor.New(opts) m.SetMonitoring(mon) ctx := context.Background() diff --git a/providers/azure/sql/databases.go b/providers/azure/sql/databases.go index ec50de4c..a3467817 100644 --- a/providers/azure/sql/databases.go +++ b/providers/azure/sql/databases.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "context" diff --git a/providers/azure/sql/databases_cost_test.go b/providers/azure/sql/databases_cost_test.go index ac6c8dae..96dcd1de 100644 --- a/providers/azure/sql/databases_cost_test.go +++ b/providers/azure/sql/databases_cost_test.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "context" diff --git a/providers/azure/sql/managedinstance.go b/providers/azure/sql/managedinstance.go index a4549ec9..ce537857 100644 --- a/providers/azure/sql/managedinstance.go +++ b/providers/azure/sql/managedinstance.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "context" diff --git a/providers/azure/sql/subresources.go b/providers/azure/sql/subresources.go index 68531bd5..fccce6a8 100644 --- a/providers/azure/sql/subresources.go +++ b/providers/azure/sql/subresources.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "bytes" diff --git a/providers/gcp/gcp.go b/providers/gcp/gcp.go index e52ee669..a926e1a9 100644 --- a/providers/gcp/gcp.go +++ b/providers/gcp/gcp.go @@ -17,9 +17,9 @@ import ( "github.com/stackshy/cloudemu/v2/providers/gcp/fcm" "github.com/stackshy/cloudemu/v2/providers/gcp/firestore" "github.com/stackshy/cloudemu/v2/providers/gcp/gce" - "github.com/stackshy/cloudemu/v2/providers/gcp/gcpiam" - "github.com/stackshy/cloudemu/v2/providers/gcp/gcplb" - "github.com/stackshy/cloudemu/v2/providers/gcp/gcpvpc" + "github.com/stackshy/cloudemu/v2/providers/gcp/iam" + "github.com/stackshy/cloudemu/v2/providers/gcp/loadbalancer" + "github.com/stackshy/cloudemu/v2/providers/gcp/vpc" "github.com/stackshy/cloudemu/v2/providers/gcp/gcs" "github.com/stackshy/cloudemu/v2/providers/gcp/gke" "github.com/stackshy/cloudemu/v2/providers/gcp/memorystore" @@ -61,11 +61,11 @@ type Provider struct { GCE *gce.Mock Firestore *firestore.Mock CloudFunctions *cloudfunctions.Mock - VPC *gcpvpc.Mock + VPC *vpc.Mock CloudMonitoring *cloudmonitoring.Mock - IAM *gcpiam.Mock + IAM *iam.Mock CloudDNS *clouddns.Mock - LB *gcplb.Mock + LB *loadbalancer.Mock PubSub *pubsub.Mock Memorystore *memorystore.Mock SecretManager *secretmanager.Mock @@ -96,11 +96,11 @@ func New(opts ...config.Option) *Provider { GCE: gce.New(o), Firestore: firestore.New(o), CloudFunctions: cloudfunctions.New(o), - VPC: gcpvpc.New(o), + VPC: vpc.New(o), CloudMonitoring: cloudmonitoring.New(o), - IAM: gcpiam.New(o), + IAM: iam.New(o), CloudDNS: clouddns.New(o), - LB: gcplb.New(o), + LB: loadbalancer.New(o), PubSub: pubsub.New(o), Memorystore: memorystore.New(o), SecretManager: secretmanager.New(o), diff --git a/providers/gcp/iam/iam.go b/providers/gcp/iam/iam.go index 58c97d07..be4ef237 100644 --- a/providers/gcp/iam/iam.go +++ b/providers/gcp/iam/iam.go @@ -1,5 +1,5 @@ -// Package gcpiam provides an in-memory mock implementation of GCP IAM. -package gcpiam +// Package iam provides an in-memory mock implementation of GCP IAM. +package iam import ( "context" diff --git a/providers/gcp/iam/iam_test.go b/providers/gcp/iam/iam_test.go index e63f66cb..e97bf611 100644 --- a/providers/gcp/iam/iam_test.go +++ b/providers/gcp/iam/iam_test.go @@ -1,4 +1,4 @@ -package gcpiam +package iam import ( "context" diff --git a/providers/gcp/loadbalancer/lb.go b/providers/gcp/loadbalancer/lb.go index 8f57beb1..5fd3cb22 100644 --- a/providers/gcp/loadbalancer/lb.go +++ b/providers/gcp/loadbalancer/lb.go @@ -1,5 +1,5 @@ -// Package gcplb provides an in-memory mock implementation of GCP Cloud Load Balancing. -package gcplb +// Package loadbalancer provides an in-memory mock implementation of GCP Cloud Load Balancing. +package loadbalancer import ( "context" diff --git a/providers/gcp/loadbalancer/lb_test.go b/providers/gcp/loadbalancer/lb_test.go index 016f009e..fa22c46e 100644 --- a/providers/gcp/loadbalancer/lb_test.go +++ b/providers/gcp/loadbalancer/lb_test.go @@ -1,4 +1,4 @@ -package gcplb +package loadbalancer import ( "context" diff --git a/providers/gcp/vpc/acl.go b/providers/gcp/vpc/acl.go index f7b675e4..f3749425 100644 --- a/providers/gcp/vpc/acl.go +++ b/providers/gcp/vpc/acl.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/vpc/eip.go b/providers/gcp/vpc/eip.go index 5b327c87..47a27ea3 100644 --- a/providers/gcp/vpc/eip.go +++ b/providers/gcp/vpc/eip.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/vpc/endpoint.go b/providers/gcp/vpc/endpoint.go index 6c2c1e7a..4f0f11a9 100644 --- a/providers/gcp/vpc/endpoint.go +++ b/providers/gcp/vpc/endpoint.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/vpc/flowlog.go b/providers/gcp/vpc/flowlog.go index b99b51ff..a1493135 100644 --- a/providers/gcp/vpc/flowlog.go +++ b/providers/gcp/vpc/flowlog.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/vpc/igw.go b/providers/gcp/vpc/igw.go index 076f6a1f..bca78c18 100644 --- a/providers/gcp/vpc/igw.go +++ b/providers/gcp/vpc/igw.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/vpc/natgw.go b/providers/gcp/vpc/natgw.go index 22c7c321..2d5cb741 100644 --- a/providers/gcp/vpc/natgw.go +++ b/providers/gcp/vpc/natgw.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/vpc/peering.go b/providers/gcp/vpc/peering.go index 809a5f43..f31931ac 100644 --- a/providers/gcp/vpc/peering.go +++ b/providers/gcp/vpc/peering.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/vpc/routetable.go b/providers/gcp/vpc/routetable.go index 0e352e27..76c7aa40 100644 --- a/providers/gcp/vpc/routetable.go +++ b/providers/gcp/vpc/routetable.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/vpc/rtassoc.go b/providers/gcp/vpc/rtassoc.go index 0837af04..c78688f6 100644 --- a/providers/gcp/vpc/rtassoc.go +++ b/providers/gcp/vpc/rtassoc.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/vpc/vpc.go b/providers/gcp/vpc/vpc.go index 9278cb88..95b8aa52 100644 --- a/providers/gcp/vpc/vpc.go +++ b/providers/gcp/vpc/vpc.go @@ -1,5 +1,5 @@ -// Package gcpvpc provides an in-memory mock implementation of Google Cloud VPC networking. -package gcpvpc +// Package vpc provides an in-memory mock implementation of Google Cloud VPC networking. +package vpc import ( "context" diff --git a/providers/gcp/vpc/vpc_test.go b/providers/gcp/vpc/vpc_test.go index d0bd023d..2dc43803 100644 --- a/providers/gcp/vpc/vpc_test.go +++ b/providers/gcp/vpc/vpc_test.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/server/aws/iam/errors_sdk_test.go b/server/aws/iam/errors_sdk_test.go index cd9aa7ea..a1523d03 100644 --- a/server/aws/iam/errors_sdk_test.go +++ b/server/aws/iam/errors_sdk_test.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsconfig "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" - awsiam "github.com/aws/aws-sdk-go-v2/service/iam" + "github.com/aws/aws-sdk-go-v2/service/iam" iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" "github.com/stackshy/cloudemu/v2" @@ -19,7 +19,7 @@ import ( // newClient is a shared helper for error-path tests. Lives here (rather than // sharing newSDKClient) so the SDK-driver wiring used to assert error codes // is colocated with those tests. -func newClient(t *testing.T) *awsiam.Client { +func newClient(t *testing.T) *iam.Client { t.Helper() cloud := cloudemu.NewAWS() @@ -41,7 +41,7 @@ func newClient(t *testing.T) *awsiam.Client { t.Fatalf("aws config: %v", err) } - return awsiam.NewFromConfig(cfg, func(o *awsiam.Options) { + return iam.NewFromConfig(cfg, func(o *iam.Options) { o.BaseEndpoint = aws.String(ts.URL) }) } @@ -54,7 +54,7 @@ func TestSDKIAMNoSuchEntityIsTyped(t *testing.T) { client := newClient(t) ctx := context.Background() - _, err := client.GetUser(ctx, &awsiam.GetUserInput{ + _, err := client.GetUser(ctx, &iam.GetUserInput{ UserName: aws.String("nobody"), }) if err == nil { @@ -73,13 +73,13 @@ func TestSDKIAMEntityAlreadyExistsIsTyped(t *testing.T) { client := newClient(t) ctx := context.Background() - if _, err := client.CreateUser(ctx, &awsiam.CreateUserInput{ + if _, err := client.CreateUser(ctx, &iam.CreateUserInput{ UserName: aws.String("dupe"), }); err != nil { t.Fatalf("first CreateUser: %v", err) } - _, err := client.CreateUser(ctx, &awsiam.CreateUserInput{ + _, err := client.CreateUser(ctx, &iam.CreateUserInput{ UserName: aws.String("dupe"), }) if err == nil { @@ -103,7 +103,7 @@ func TestSDKIAMClaimsActionsBeforeEC2(t *testing.T) { client := newClient(t) ctx := context.Background() - out, err := client.CreateUser(ctx, &awsiam.CreateUserInput{ + out, err := client.CreateUser(ctx, &iam.CreateUserInput{ UserName: aws.String("precedence"), }) if err != nil { diff --git a/server/aws/iam/sdk_roundtrip_test.go b/server/aws/iam/sdk_roundtrip_test.go index f443d1ff..3a44c5ce 100644 --- a/server/aws/iam/sdk_roundtrip_test.go +++ b/server/aws/iam/sdk_roundtrip_test.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsconfig "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" - awsiam "github.com/aws/aws-sdk-go-v2/service/iam" + "github.com/aws/aws-sdk-go-v2/service/iam" iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" "github.com/stackshy/cloudemu/v2" @@ -34,7 +34,7 @@ const samplePolicy = `{ }] }` -func newSDKClient(t *testing.T) *awsiam.Client { +func newSDKClient(t *testing.T) *iam.Client { t.Helper() cloud := cloudemu.NewAWS() @@ -59,7 +59,7 @@ func newSDKClient(t *testing.T) *awsiam.Client { t.Fatalf("aws config: %v", err) } - return awsiam.NewFromConfig(cfg, func(o *awsiam.Options) { + return iam.NewFromConfig(cfg, func(o *iam.Options) { o.BaseEndpoint = aws.String(ts.URL) }) } @@ -68,7 +68,7 @@ func TestSDKIAMUserLifecycle(t *testing.T) { client := newSDKClient(t) ctx := context.Background() - created, err := client.CreateUser(ctx, &awsiam.CreateUserInput{ + created, err := client.CreateUser(ctx, &iam.CreateUserInput{ UserName: aws.String("alice"), Path: aws.String("/team/"), Tags: []iamtypes.Tag{ @@ -83,7 +83,7 @@ func TestSDKIAMUserLifecycle(t *testing.T) { t.Fatalf("got user name %q, want alice", aws.ToString(created.User.UserName)) } - got, err := client.GetUser(ctx, &awsiam.GetUserInput{UserName: aws.String("alice")}) + got, err := client.GetUser(ctx, &iam.GetUserInput{UserName: aws.String("alice")}) if err != nil { t.Fatalf("GetUser: %v", err) } @@ -92,7 +92,7 @@ func TestSDKIAMUserLifecycle(t *testing.T) { t.Fatalf("got user name %q after roundtrip, want alice", aws.ToString(got.User.UserName)) } - listed, err := client.ListUsers(ctx, &awsiam.ListUsersInput{}) + listed, err := client.ListUsers(ctx, &iam.ListUsersInput{}) if err != nil { t.Fatalf("ListUsers: %v", err) } @@ -101,11 +101,11 @@ func TestSDKIAMUserLifecycle(t *testing.T) { t.Fatalf("got %d users, want 1", len(listed.Users)) } - if _, err := client.DeleteUser(ctx, &awsiam.DeleteUserInput{UserName: aws.String("alice")}); err != nil { + if _, err := client.DeleteUser(ctx, &iam.DeleteUserInput{UserName: aws.String("alice")}); err != nil { t.Fatalf("DeleteUser: %v", err) } - if _, err := client.GetUser(ctx, &awsiam.GetUserInput{UserName: aws.String("alice")}); err == nil { + if _, err := client.GetUser(ctx, &iam.GetUserInput{UserName: aws.String("alice")}); err == nil { t.Fatalf("GetUser after delete: expected error, got nil") } } @@ -116,14 +116,14 @@ func TestSDKInlineRolePolicy(t *testing.T) { client := newSDKClient(t) ctx := context.Background() - if _, err := client.CreateRole(ctx, &awsiam.CreateRoleInput{ + if _, err := client.CreateRole(ctx, &iam.CreateRoleInput{ RoleName: aws.String("inline-role"), AssumeRolePolicyDocument: aws.String(trustPolicy), }); err != nil { t.Fatalf("CreateRole: %v", err) } - if _, err := client.PutRolePolicy(ctx, &awsiam.PutRolePolicyInput{ + if _, err := client.PutRolePolicy(ctx, &iam.PutRolePolicyInput{ RoleName: aws.String("inline-role"), PolicyName: aws.String("s3access"), PolicyDocument: aws.String(samplePolicy), @@ -131,7 +131,7 @@ func TestSDKInlineRolePolicy(t *testing.T) { t.Fatalf("PutRolePolicy: %v", err) } - list, err := client.ListRolePolicies(ctx, &awsiam.ListRolePoliciesInput{RoleName: aws.String("inline-role")}) + list, err := client.ListRolePolicies(ctx, &iam.ListRolePoliciesInput{RoleName: aws.String("inline-role")}) if err != nil { t.Fatalf("ListRolePolicies: %v", err) } @@ -140,7 +140,7 @@ func TestSDKInlineRolePolicy(t *testing.T) { t.Fatalf("ListRolePolicies = %v", list.PolicyNames) } - got, err := client.GetRolePolicy(ctx, &awsiam.GetRolePolicyInput{ + got, err := client.GetRolePolicy(ctx, &iam.GetRolePolicyInput{ RoleName: aws.String("inline-role"), PolicyName: aws.String("s3access"), }) if err != nil { @@ -151,13 +151,13 @@ func TestSDKInlineRolePolicy(t *testing.T) { t.Fatal("GetRolePolicy returned empty document") } - if _, err := client.DeleteRolePolicy(ctx, &awsiam.DeleteRolePolicyInput{ + if _, err := client.DeleteRolePolicy(ctx, &iam.DeleteRolePolicyInput{ RoleName: aws.String("inline-role"), PolicyName: aws.String("s3access"), }); err != nil { t.Fatalf("DeleteRolePolicy: %v", err) } - list, err = client.ListRolePolicies(ctx, &awsiam.ListRolePoliciesInput{RoleName: aws.String("inline-role")}) + list, err = client.ListRolePolicies(ctx, &iam.ListRolePoliciesInput{RoleName: aws.String("inline-role")}) if err != nil { t.Fatalf("ListRolePolicies after delete: %v", err) } @@ -171,7 +171,7 @@ func TestSDKIAMRoleAndPolicy(t *testing.T) { client := newSDKClient(t) ctx := context.Background() - role, err := client.CreateRole(ctx, &awsiam.CreateRoleInput{ + role, err := client.CreateRole(ctx, &iam.CreateRoleInput{ RoleName: aws.String("app-role"), AssumeRolePolicyDocument: aws.String(trustPolicy), }) @@ -183,7 +183,7 @@ func TestSDKIAMRoleAndPolicy(t *testing.T) { t.Fatalf("got role %q, want app-role", aws.ToString(role.Role.RoleName)) } - policy, err := client.CreatePolicy(ctx, &awsiam.CreatePolicyInput{ + policy, err := client.CreatePolicy(ctx, &iam.CreatePolicyInput{ PolicyName: aws.String("list-bucket"), PolicyDocument: aws.String(samplePolicy), Description: aws.String("allow listing"), @@ -197,14 +197,14 @@ func TestSDKIAMRoleAndPolicy(t *testing.T) { t.Fatalf("CreatePolicy returned empty ARN") } - if _, err := client.AttachRolePolicy(ctx, &awsiam.AttachRolePolicyInput{ + if _, err := client.AttachRolePolicy(ctx, &iam.AttachRolePolicyInput{ RoleName: aws.String("app-role"), PolicyArn: aws.String(policyArn), }); err != nil { t.Fatalf("AttachRolePolicy: %v", err) } - attached, err := client.ListAttachedRolePolicies(ctx, &awsiam.ListAttachedRolePoliciesInput{ + attached, err := client.ListAttachedRolePolicies(ctx, &iam.ListAttachedRolePoliciesInput{ RoleName: aws.String("app-role"), }) if err != nil { @@ -220,7 +220,7 @@ func TestSDKIAMRoleAndPolicy(t *testing.T) { aws.ToString(attached.AttachedPolicies[0].PolicyArn), policyArn) } - if _, err := client.DetachRolePolicy(ctx, &awsiam.DetachRolePolicyInput{ + if _, err := client.DetachRolePolicy(ctx, &iam.DetachRolePolicyInput{ RoleName: aws.String("app-role"), PolicyArn: aws.String(policyArn), }); err != nil { @@ -232,26 +232,26 @@ func TestSDKIAMGroupsAndMembership(t *testing.T) { client := newSDKClient(t) ctx := context.Background() - if _, err := client.CreateUser(ctx, &awsiam.CreateUserInput{ + if _, err := client.CreateUser(ctx, &iam.CreateUserInput{ UserName: aws.String("bob"), }); err != nil { t.Fatalf("CreateUser: %v", err) } - if _, err := client.CreateGroup(ctx, &awsiam.CreateGroupInput{ + if _, err := client.CreateGroup(ctx, &iam.CreateGroupInput{ GroupName: aws.String("admins"), }); err != nil { t.Fatalf("CreateGroup: %v", err) } - if _, err := client.AddUserToGroup(ctx, &awsiam.AddUserToGroupInput{ + if _, err := client.AddUserToGroup(ctx, &iam.AddUserToGroupInput{ UserName: aws.String("bob"), GroupName: aws.String("admins"), }); err != nil { t.Fatalf("AddUserToGroup: %v", err) } - groups, err := client.ListGroupsForUser(ctx, &awsiam.ListGroupsForUserInput{ + groups, err := client.ListGroupsForUser(ctx, &iam.ListGroupsForUserInput{ UserName: aws.String("bob"), }) if err != nil { @@ -262,7 +262,7 @@ func TestSDKIAMGroupsAndMembership(t *testing.T) { t.Fatalf("got groups %+v, want one entry named admins", groups.Groups) } - if _, err := client.RemoveUserFromGroup(ctx, &awsiam.RemoveUserFromGroupInput{ + if _, err := client.RemoveUserFromGroup(ctx, &iam.RemoveUserFromGroupInput{ UserName: aws.String("bob"), GroupName: aws.String("admins"), }); err != nil { @@ -274,13 +274,13 @@ func TestSDKIAMAccessKeys(t *testing.T) { client := newSDKClient(t) ctx := context.Background() - if _, err := client.CreateUser(ctx, &awsiam.CreateUserInput{ + if _, err := client.CreateUser(ctx, &iam.CreateUserInput{ UserName: aws.String("carol"), }); err != nil { t.Fatalf("CreateUser: %v", err) } - created, err := client.CreateAccessKey(ctx, &awsiam.CreateAccessKeyInput{ + created, err := client.CreateAccessKey(ctx, &iam.CreateAccessKeyInput{ UserName: aws.String("carol"), }) if err != nil { @@ -296,7 +296,7 @@ func TestSDKIAMAccessKeys(t *testing.T) { t.Fatalf("CreateAccessKey returned empty secret") } - listed, err := client.ListAccessKeys(ctx, &awsiam.ListAccessKeysInput{ + listed, err := client.ListAccessKeys(ctx, &iam.ListAccessKeysInput{ UserName: aws.String("carol"), }) if err != nil { @@ -307,7 +307,7 @@ func TestSDKIAMAccessKeys(t *testing.T) { t.Fatalf("got %d keys, want 1", len(listed.AccessKeyMetadata)) } - if _, err := client.DeleteAccessKey(ctx, &awsiam.DeleteAccessKeyInput{ + if _, err := client.DeleteAccessKey(ctx, &iam.DeleteAccessKeyInput{ UserName: aws.String("carol"), AccessKeyId: aws.String(keyID), }); err != nil { @@ -319,14 +319,14 @@ func TestSDKIAMInstanceProfiles(t *testing.T) { client := newSDKClient(t) ctx := context.Background() - if _, err := client.CreateRole(ctx, &awsiam.CreateRoleInput{ + if _, err := client.CreateRole(ctx, &iam.CreateRoleInput{ RoleName: aws.String("ec2-role"), AssumeRolePolicyDocument: aws.String(trustPolicy), }); err != nil { t.Fatalf("CreateRole: %v", err) } - profile, err := client.CreateInstanceProfile(ctx, &awsiam.CreateInstanceProfileInput{ + profile, err := client.CreateInstanceProfile(ctx, &iam.CreateInstanceProfileInput{ InstanceProfileName: aws.String("ec2-profile"), }) if err != nil { @@ -338,14 +338,14 @@ func TestSDKIAMInstanceProfiles(t *testing.T) { aws.ToString(profile.InstanceProfile.InstanceProfileName)) } - if _, err := client.AddRoleToInstanceProfile(ctx, &awsiam.AddRoleToInstanceProfileInput{ + if _, err := client.AddRoleToInstanceProfile(ctx, &iam.AddRoleToInstanceProfileInput{ InstanceProfileName: aws.String("ec2-profile"), RoleName: aws.String("ec2-role"), }); err != nil { t.Fatalf("AddRoleToInstanceProfile: %v", err) } - got, err := client.GetInstanceProfile(ctx, &awsiam.GetInstanceProfileInput{ + got, err := client.GetInstanceProfile(ctx, &iam.GetInstanceProfileInput{ InstanceProfileName: aws.String("ec2-profile"), }) if err != nil { @@ -358,24 +358,24 @@ func TestSDKIAMInstanceProfiles(t *testing.T) { got.InstanceProfile.Roles) } - if _, err := client.RemoveRoleFromInstanceProfile(ctx, &awsiam.RemoveRoleFromInstanceProfileInput{ + if _, err := client.RemoveRoleFromInstanceProfile(ctx, &iam.RemoveRoleFromInstanceProfileInput{ InstanceProfileName: aws.String("ec2-profile"), RoleName: aws.String("ec2-role"), }); err != nil { t.Fatalf("RemoveRoleFromInstanceProfile: %v", err) } - if _, err := client.DeleteInstanceProfile(ctx, &awsiam.DeleteInstanceProfileInput{ + if _, err := client.DeleteInstanceProfile(ctx, &iam.DeleteInstanceProfileInput{ InstanceProfileName: aws.String("ec2-profile"), }); err != nil { t.Fatalf("DeleteInstanceProfile: %v", err) } } -func createPolicyForVersions(t *testing.T, client *awsiam.Client, name string) string { +func createPolicyForVersions(t *testing.T, client *iam.Client, name string) string { t.Helper() - out, err := client.CreatePolicy(context.Background(), &awsiam.CreatePolicyInput{ + out, err := client.CreatePolicy(context.Background(), &iam.CreatePolicyInput{ PolicyName: aws.String(name), PolicyDocument: aws.String(samplePolicy), }) @@ -392,7 +392,7 @@ func TestSDKIAMPolicyVersionLifecycle(t *testing.T) { arn := createPolicyForVersions(t, client, "versioned") // CreatePolicy auto-seeds a default v1. - listed, err := client.ListPolicyVersions(ctx, &awsiam.ListPolicyVersionsInput{PolicyArn: aws.String(arn)}) + listed, err := client.ListPolicyVersions(ctx, &iam.ListPolicyVersionsInput{PolicyArn: aws.String(arn)}) if err != nil { t.Fatalf("ListPolicyVersions: %v", err) } @@ -404,7 +404,7 @@ func TestSDKIAMPolicyVersionLifecycle(t *testing.T) { const docV2 = `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:GetObject","Resource":"*"}]}` - created, err := client.CreatePolicyVersion(ctx, &awsiam.CreatePolicyVersionInput{ + created, err := client.CreatePolicyVersion(ctx, &iam.CreatePolicyVersionInput{ PolicyArn: aws.String(arn), PolicyDocument: aws.String(docV2), SetAsDefault: true, @@ -418,7 +418,7 @@ func TestSDKIAMPolicyVersionLifecycle(t *testing.T) { } // GetPolicyVersion round-trips the stored document. - gotVer, err := client.GetPolicyVersion(ctx, &awsiam.GetPolicyVersionInput{ + gotVer, err := client.GetPolicyVersion(ctx, &iam.GetPolicyVersionInput{ PolicyArn: aws.String(arn), VersionId: aws.String("v2"), }) if err != nil { @@ -432,7 +432,7 @@ func TestSDKIAMPolicyVersionLifecycle(t *testing.T) { // GetPolicy reflects the new default, then tracks SetDefaultPolicyVersion. assertDefaultVersion(t, client, arn, "v2") - if _, err := client.SetDefaultPolicyVersion(ctx, &awsiam.SetDefaultPolicyVersionInput{ + if _, err := client.SetDefaultPolicyVersion(ctx, &iam.SetDefaultPolicyVersionInput{ PolicyArn: aws.String(arn), VersionId: aws.String("v1"), }); err != nil { t.Fatalf("SetDefaultPolicyVersion: %v", err) @@ -441,10 +441,10 @@ func TestSDKIAMPolicyVersionLifecycle(t *testing.T) { assertDefaultVersion(t, client, arn, "v1") } -func assertDefaultVersion(t *testing.T, client *awsiam.Client, arn, want string) { +func assertDefaultVersion(t *testing.T, client *iam.Client, arn, want string) { t.Helper() - pol, err := client.GetPolicy(context.Background(), &awsiam.GetPolicyInput{PolicyArn: aws.String(arn)}) + pol, err := client.GetPolicy(context.Background(), &iam.GetPolicyInput{PolicyArn: aws.String(arn)}) if err != nil { t.Fatalf("GetPolicy: %v", err) } @@ -460,7 +460,7 @@ func TestSDKIAMPolicyVersionEdgeCases(t *testing.T) { arn := createPolicyForVersions(t, client, "edge") // The default version cannot be deleted (AWS DeleteConflict). - _, err := client.DeletePolicyVersion(ctx, &awsiam.DeletePolicyVersionInput{ + _, err := client.DeletePolicyVersion(ctx, &iam.DeletePolicyVersionInput{ PolicyArn: aws.String(arn), VersionId: aws.String("v1"), }) @@ -470,13 +470,13 @@ func TestSDKIAMPolicyVersionEdgeCases(t *testing.T) { } // A non-default version can be deleted. - if _, err := client.CreatePolicyVersion(ctx, &awsiam.CreatePolicyVersionInput{ + if _, err := client.CreatePolicyVersion(ctx, &iam.CreatePolicyVersionInput{ PolicyArn: aws.String(arn), PolicyDocument: aws.String(samplePolicy), }); err != nil { t.Fatalf("CreatePolicyVersion: %v", err) } - if _, err := client.DeletePolicyVersion(ctx, &awsiam.DeletePolicyVersionInput{ + if _, err := client.DeletePolicyVersion(ctx, &iam.DeletePolicyVersionInput{ PolicyArn: aws.String(arn), VersionId: aws.String("v2"), }); err != nil { t.Fatalf("DeletePolicyVersion(v2): %v", err) @@ -485,14 +485,14 @@ func TestSDKIAMPolicyVersionEdgeCases(t *testing.T) { // Unknown version and unknown policy both map to NoSuchEntity. var notFound *iamtypes.NoSuchEntityException - _, err = client.GetPolicyVersion(ctx, &awsiam.GetPolicyVersionInput{ + _, err = client.GetPolicyVersion(ctx, &iam.GetPolicyVersionInput{ PolicyArn: aws.String(arn), VersionId: aws.String("v99"), }) if !errors.As(err, ¬Found) { t.Fatalf("get unknown version: want NoSuchEntityException, got %v", err) } - _, err = client.CreatePolicyVersion(ctx, &awsiam.CreatePolicyVersionInput{ + _, err = client.CreatePolicyVersion(ctx, &iam.CreatePolicyVersionInput{ PolicyArn: aws.String("arn:aws:iam::123456789012:policy/missing"), PolicyDocument: aws.String(samplePolicy), }) @@ -508,14 +508,14 @@ func TestSDKIAMPolicyVersionLimit(t *testing.T) { // v1 is seeded; four more reach the maximum of five. for range 4 { - if _, err := client.CreatePolicyVersion(ctx, &awsiam.CreatePolicyVersionInput{ + if _, err := client.CreatePolicyVersion(ctx, &iam.CreatePolicyVersionInput{ PolicyArn: aws.String(arn), PolicyDocument: aws.String(samplePolicy), }); err != nil { t.Fatalf("CreatePolicyVersion: %v", err) } } - _, err := client.CreatePolicyVersion(ctx, &awsiam.CreatePolicyVersionInput{ + _, err := client.CreatePolicyVersion(ctx, &iam.CreatePolicyVersionInput{ PolicyArn: aws.String(arn), PolicyDocument: aws.String(samplePolicy), }) diff --git a/services/azureai/azureai_test.go b/services/azureai/azureai_test.go index 256d85e9..2475fe41 100644 --- a/services/azureai/azureai_test.go +++ b/services/azureai/azureai_test.go @@ -13,7 +13,7 @@ import ( "github.com/stackshy/cloudemu/v2/features/inject" "github.com/stackshy/cloudemu/v2/features/metrics" "github.com/stackshy/cloudemu/v2/features/recorder" - provazureai "github.com/stackshy/cloudemu/v2/providers/azure/azureai" + provazureai "github.com/stackshy/cloudemu/v2/providers/azure/ai" "github.com/stackshy/cloudemu/v2/services/azureai" "github.com/stackshy/cloudemu/v2/services/azureai/driver" ) diff --git a/services/azuresearch/azuresearch_test.go b/services/azuresearch/azuresearch_test.go index f5bbe745..e2361c3c 100644 --- a/services/azuresearch/azuresearch_test.go +++ b/services/azuresearch/azuresearch_test.go @@ -13,7 +13,7 @@ import ( "github.com/stackshy/cloudemu/v2/features/inject" "github.com/stackshy/cloudemu/v2/features/metrics" "github.com/stackshy/cloudemu/v2/features/recorder" - provsearch "github.com/stackshy/cloudemu/v2/providers/azure/azuresearch" + provsearch "github.com/stackshy/cloudemu/v2/providers/azure/search" "github.com/stackshy/cloudemu/v2/services/azuresearch" "github.com/stackshy/cloudemu/v2/services/azuresearch/driver" ) From 6a12bb16fca62c76ab3c92f34ff6adf7fa44f01f Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 02:46:05 +0530 Subject: [PATCH 03/15] refactor(server): drop redundant cloud prefixes from azure wire dirs (#325) --- server/azure/{azureai => ai}/accounts.go | 2 +- server/azure/{azureai => ai}/assistants.go | 2 +- server/azure/{azureai => ai}/children.go | 2 +- server/azure/{azureai => ai}/dataplane.go | 2 +- server/azure/{azureai => ai}/dataplane_roundtrip_test.go | 2 +- server/azure/{azureai => ai}/handler.go | 4 ++-- server/azure/{azureai => ai}/machinelearning.go | 2 +- server/azure/{azureai => ai}/machinelearning_children.go | 2 +- .../{azureai => ai}/machinelearning_roundtrip_test.go | 2 +- server/azure/{azureai => ai}/machinelearning_simple.go | 2 +- server/azure/{azureai => ai}/sdk_roundtrip_test.go | 2 +- server/azure/azure.go | 8 ++++---- server/azure/{azuresearch => search}/control_actions.go | 2 +- server/azure/{azuresearch => search}/dataplane.go | 2 +- server/azure/{azuresearch => search}/dataplane_docs.go | 2 +- .../azure/{azuresearch => search}/dataplane_resources.go | 2 +- .../{azuresearch => search}/dataplane_roundtrip_test.go | 2 +- server/azure/{azuresearch => search}/handler.go | 4 ++-- .../azure/{azuresearch => search}/sdk_roundtrip_test.go | 2 +- server/azure/{azuresql => sql}/cost_fields_sdk_test.go | 2 +- server/azure/{azuresql => sql}/error_paths_test.go | 2 +- server/azure/{azuresql => sql}/handler.go | 4 ++-- server/azure/{azuresql => sql}/managedinstance.go | 2 +- .../azure/{azuresql => sql}/managedinstance_raw_test.go | 2 +- server/azure/{azuresql => sql}/operations.go | 2 +- server/azure/{azuresql => sql}/sdk_roundtrip_test.go | 2 +- server/azure/{azuresql => sql}/subresources.go | 2 +- server/azure/{azuresql => sql}/subresources_sdk_test.go | 2 +- server/azure/{azuresql => sql}/types.go | 2 +- 29 files changed, 35 insertions(+), 35 deletions(-) rename server/azure/{azureai => ai}/accounts.go (99%) rename server/azure/{azureai => ai}/assistants.go (99%) rename server/azure/{azureai => ai}/children.go (99%) rename server/azure/{azureai => ai}/dataplane.go (99%) rename server/azure/{azureai => ai}/dataplane_roundtrip_test.go (99%) rename server/azure/{azureai => ai}/handler.go (97%) rename server/azure/{azureai => ai}/machinelearning.go (99%) rename server/azure/{azureai => ai}/machinelearning_children.go (99%) rename server/azure/{azureai => ai}/machinelearning_roundtrip_test.go (99%) rename server/azure/{azureai => ai}/machinelearning_simple.go (99%) rename server/azure/{azureai => ai}/sdk_roundtrip_test.go (99%) rename server/azure/{azuresearch => search}/control_actions.go (99%) rename server/azure/{azuresearch => search}/dataplane.go (99%) rename server/azure/{azuresearch => search}/dataplane_docs.go (99%) rename server/azure/{azuresearch => search}/dataplane_resources.go (99%) rename server/azure/{azuresearch => search}/dataplane_roundtrip_test.go (99%) rename server/azure/{azuresearch => search}/handler.go (98%) rename server/azure/{azuresearch => search}/sdk_roundtrip_test.go (99%) rename server/azure/{azuresql => sql}/cost_fields_sdk_test.go (99%) rename server/azure/{azuresql => sql}/error_paths_test.go (98%) rename server/azure/{azuresql => sql}/handler.go (98%) rename server/azure/{azuresql => sql}/managedinstance.go (99%) rename server/azure/{azuresql => sql}/managedinstance_raw_test.go (98%) rename server/azure/{azuresql => sql}/operations.go (99%) rename server/azure/{azuresql => sql}/sdk_roundtrip_test.go (99%) rename server/azure/{azuresql => sql}/subresources.go (99%) rename server/azure/{azuresql => sql}/subresources_sdk_test.go (99%) rename server/azure/{azuresql => sql}/types.go (99%) diff --git a/server/azure/azureai/accounts.go b/server/azure/ai/accounts.go similarity index 99% rename from server/azure/azureai/accounts.go rename to server/azure/ai/accounts.go index 8dc57eac..372e816c 100644 --- a/server/azure/azureai/accounts.go +++ b/server/azure/ai/accounts.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "net/http" diff --git a/server/azure/azureai/assistants.go b/server/azure/ai/assistants.go similarity index 99% rename from server/azure/azureai/assistants.go rename to server/azure/ai/assistants.go index ba129908..cacda846 100644 --- a/server/azure/azureai/assistants.go +++ b/server/azure/ai/assistants.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "net/http" diff --git a/server/azure/azureai/children.go b/server/azure/ai/children.go similarity index 99% rename from server/azure/azureai/children.go rename to server/azure/ai/children.go index 9e243a44..5f7ed4b4 100644 --- a/server/azure/azureai/children.go +++ b/server/azure/ai/children.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "net/http" diff --git a/server/azure/azureai/dataplane.go b/server/azure/ai/dataplane.go similarity index 99% rename from server/azure/azureai/dataplane.go rename to server/azure/ai/dataplane.go index eb5cbf81..1ed5b20a 100644 --- a/server/azure/azureai/dataplane.go +++ b/server/azure/ai/dataplane.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "encoding/json" diff --git a/server/azure/azureai/dataplane_roundtrip_test.go b/server/azure/ai/dataplane_roundtrip_test.go similarity index 99% rename from server/azure/azureai/dataplane_roundtrip_test.go rename to server/azure/ai/dataplane_roundtrip_test.go index fd2343d6..6c77a815 100644 --- a/server/azure/azureai/dataplane_roundtrip_test.go +++ b/server/azure/ai/dataplane_roundtrip_test.go @@ -1,4 +1,4 @@ -package azureai_test +package ai_test import ( "context" diff --git a/server/azure/azureai/handler.go b/server/azure/ai/handler.go similarity index 97% rename from server/azure/azureai/handler.go rename to server/azure/ai/handler.go index 8a3d2f6d..930ba8ec 100644 --- a/server/azure/azureai/handler.go +++ b/server/azure/ai/handler.go @@ -1,4 +1,4 @@ -// Package azureai implements the Azure AI ARM REST APIs as server.Handlers. +// Package ai implements the Azure AI ARM REST APIs as server.Handlers. // This file serves Microsoft.CognitiveServices (AI Foundry / AI Studio / the AI // Services resource / Azure OpenAI). Real // github.com/Azure/azure-sdk-for-go/.../armcognitiveservices clients configured @@ -18,7 +18,7 @@ // // ARM PUT returns the resource inline with a terminal provisioningState so the // SDK LRO poller terminates on the first response. -package azureai +package ai import ( "net/http" diff --git a/server/azure/azureai/machinelearning.go b/server/azure/ai/machinelearning.go similarity index 99% rename from server/azure/azureai/machinelearning.go rename to server/azure/ai/machinelearning.go index 2d1b8ed5..a1064a5b 100644 --- a/server/azure/azureai/machinelearning.go +++ b/server/azure/ai/machinelearning.go @@ -14,7 +14,7 @@ // // AML paths nest deeper than the shared azurearm.ParsePath captures, so this // handler parses the trailing segments itself. -package azureai +package ai import ( "net/http" diff --git a/server/azure/azureai/machinelearning_children.go b/server/azure/ai/machinelearning_children.go similarity index 99% rename from server/azure/azureai/machinelearning_children.go rename to server/azure/ai/machinelearning_children.go index 36ad0d4d..548836c3 100644 --- a/server/azure/azureai/machinelearning_children.go +++ b/server/azure/ai/machinelearning_children.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "net/http" diff --git a/server/azure/azureai/machinelearning_roundtrip_test.go b/server/azure/ai/machinelearning_roundtrip_test.go similarity index 99% rename from server/azure/azureai/machinelearning_roundtrip_test.go rename to server/azure/ai/machinelearning_roundtrip_test.go index c44c4965..a4bb54db 100644 --- a/server/azure/azureai/machinelearning_roundtrip_test.go +++ b/server/azure/ai/machinelearning_roundtrip_test.go @@ -1,4 +1,4 @@ -package azureai_test +package ai_test import ( "context" diff --git a/server/azure/azureai/machinelearning_simple.go b/server/azure/ai/machinelearning_simple.go similarity index 99% rename from server/azure/azureai/machinelearning_simple.go rename to server/azure/ai/machinelearning_simple.go index d8c26b87..3823f25c 100644 --- a/server/azure/azureai/machinelearning_simple.go +++ b/server/azure/ai/machinelearning_simple.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "net/http" diff --git a/server/azure/azureai/sdk_roundtrip_test.go b/server/azure/ai/sdk_roundtrip_test.go similarity index 99% rename from server/azure/azureai/sdk_roundtrip_test.go rename to server/azure/ai/sdk_roundtrip_test.go index b42bcbbf..af8189fb 100644 --- a/server/azure/azureai/sdk_roundtrip_test.go +++ b/server/azure/ai/sdk_roundtrip_test.go @@ -1,4 +1,4 @@ -package azureai_test +package ai_test import ( "bytes" diff --git a/server/azure/azure.go b/server/azure/azure.go index 7c57abbb..c5bd85ee 100644 --- a/server/azure/azure.go +++ b/server/azure/azure.go @@ -10,9 +10,9 @@ import ( "github.com/stackshy/cloudemu/v2/server" "github.com/stackshy/cloudemu/v2/server/azure/acr" aksserver "github.com/stackshy/cloudemu/v2/server/azure/aks" - azureaiserver "github.com/stackshy/cloudemu/v2/server/azure/azureai" - azuresearchserver "github.com/stackshy/cloudemu/v2/server/azure/azuresearch" - "github.com/stackshy/cloudemu/v2/server/azure/azuresql" + azureaiserver "github.com/stackshy/cloudemu/v2/server/azure/ai" + azuresearchserver "github.com/stackshy/cloudemu/v2/server/azure/search" + "github.com/stackshy/cloudemu/v2/server/azure/sql" "github.com/stackshy/cloudemu/v2/server/azure/blob" cachesrv "github.com/stackshy/cloudemu/v2/server/azure/cache" "github.com/stackshy/cloudemu/v2/server/azure/cosmos" @@ -291,7 +291,7 @@ func New(d Drivers) *server.Server { // Microsoft.Sql provider — distinct ARM provider name from compute and // network so registration order is unconstrained. if d.SQL != nil { - srv.Register(azuresql.New(d.SQL)) + srv.Register(sql.New(d.SQL)) } // Postgres Flex matches on a distinct provider name diff --git a/server/azure/azuresearch/control_actions.go b/server/azure/search/control_actions.go similarity index 99% rename from server/azure/azuresearch/control_actions.go rename to server/azure/search/control_actions.go index 7046d225..d93cafe8 100644 --- a/server/azure/azuresearch/control_actions.go +++ b/server/azure/search/control_actions.go @@ -1,4 +1,4 @@ -package azuresearch +package search import ( "net/http" diff --git a/server/azure/azuresearch/dataplane.go b/server/azure/search/dataplane.go similarity index 99% rename from server/azure/azuresearch/dataplane.go rename to server/azure/search/dataplane.go index 5b00d923..0b59294c 100644 --- a/server/azure/azuresearch/dataplane.go +++ b/server/azure/search/dataplane.go @@ -1,4 +1,4 @@ -package azuresearch +package search import ( "encoding/json" diff --git a/server/azure/azuresearch/dataplane_docs.go b/server/azure/search/dataplane_docs.go similarity index 99% rename from server/azure/azuresearch/dataplane_docs.go rename to server/azure/search/dataplane_docs.go index 86ce7b51..9c5d6ddd 100644 --- a/server/azure/azuresearch/dataplane_docs.go +++ b/server/azure/search/dataplane_docs.go @@ -1,4 +1,4 @@ -package azuresearch +package search import ( "net/http" diff --git a/server/azure/azuresearch/dataplane_resources.go b/server/azure/search/dataplane_resources.go similarity index 99% rename from server/azure/azuresearch/dataplane_resources.go rename to server/azure/search/dataplane_resources.go index a7807616..6b68db0e 100644 --- a/server/azure/azuresearch/dataplane_resources.go +++ b/server/azure/search/dataplane_resources.go @@ -1,4 +1,4 @@ -package azuresearch +package search import ( "net/http" diff --git a/server/azure/azuresearch/dataplane_roundtrip_test.go b/server/azure/search/dataplane_roundtrip_test.go similarity index 99% rename from server/azure/azuresearch/dataplane_roundtrip_test.go rename to server/azure/search/dataplane_roundtrip_test.go index f47080af..f1c47a62 100644 --- a/server/azure/azuresearch/dataplane_roundtrip_test.go +++ b/server/azure/search/dataplane_roundtrip_test.go @@ -1,4 +1,4 @@ -package azuresearch_test +package search_test import ( "bytes" diff --git a/server/azure/azuresearch/handler.go b/server/azure/search/handler.go similarity index 98% rename from server/azure/azuresearch/handler.go rename to server/azure/search/handler.go index a03fa8ff..cdfafe8b 100644 --- a/server/azure/azuresearch/handler.go +++ b/server/azure/search/handler.go @@ -1,4 +1,4 @@ -// Package azuresearch implements the Azure AI Search REST APIs as +// Package search implements the Azure AI Search REST APIs as // server.Handlers: the Microsoft.Search ARM control plane (service lifecycle, // admin/query keys, private links) and the {service}.search.windows.net data // plane (indexes, documents, indexers, data sources, skillsets, synonym maps, @@ -7,7 +7,7 @@ // Real armsearch clients (and the azsearch data-plane client) configured with a // custom endpoint hit these handlers the same way they hit management.azure.com // and {service}.search.windows.net. -package azuresearch +package search import ( "net/http" diff --git a/server/azure/azuresearch/sdk_roundtrip_test.go b/server/azure/search/sdk_roundtrip_test.go similarity index 99% rename from server/azure/azuresearch/sdk_roundtrip_test.go rename to server/azure/search/sdk_roundtrip_test.go index 68c5421d..f4518325 100644 --- a/server/azure/azuresearch/sdk_roundtrip_test.go +++ b/server/azure/search/sdk_roundtrip_test.go @@ -1,4 +1,4 @@ -package azuresearch_test +package search_test import ( "bytes" diff --git a/server/azure/azuresql/cost_fields_sdk_test.go b/server/azure/sql/cost_fields_sdk_test.go similarity index 99% rename from server/azure/azuresql/cost_fields_sdk_test.go rename to server/azure/sql/cost_fields_sdk_test.go index 8fe0f1b5..6deee3bd 100644 --- a/server/azure/azuresql/cost_fields_sdk_test.go +++ b/server/azure/sql/cost_fields_sdk_test.go @@ -1,4 +1,4 @@ -package azuresql_test +package sql_test import ( "context" diff --git a/server/azure/azuresql/error_paths_test.go b/server/azure/sql/error_paths_test.go similarity index 98% rename from server/azure/azuresql/error_paths_test.go rename to server/azure/sql/error_paths_test.go index b0a3f8c5..35b443c4 100644 --- a/server/azure/azuresql/error_paths_test.go +++ b/server/azure/sql/error_paths_test.go @@ -1,4 +1,4 @@ -package azuresql_test +package sql_test import ( "context" diff --git a/server/azure/azuresql/handler.go b/server/azure/sql/handler.go similarity index 98% rename from server/azure/azuresql/handler.go rename to server/azure/sql/handler.go index eb357bee..5e5587ae 100644 --- a/server/azure/azuresql/handler.go +++ b/server/azure/sql/handler.go @@ -1,4 +1,4 @@ -// Package azuresql implements the Azure SQL Database (Microsoft.Sql) ARM +// Package sql implements the Azure SQL Database (Microsoft.Sql) ARM // REST API as a server.Handler. Real // github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql clients // configured with a custom endpoint hit this handler the same way they hit @@ -18,7 +18,7 @@ // // Mutating ops return 200 OK with the resource body inline so the SDK's LRO // poller terminates on the first response. -package azuresql +package sql import ( "net/http" diff --git a/server/azure/azuresql/managedinstance.go b/server/azure/sql/managedinstance.go similarity index 99% rename from server/azure/azuresql/managedinstance.go rename to server/azure/sql/managedinstance.go index f8ea27b4..9942b089 100644 --- a/server/azure/azuresql/managedinstance.go +++ b/server/azure/sql/managedinstance.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "net/http" diff --git a/server/azure/azuresql/managedinstance_raw_test.go b/server/azure/sql/managedinstance_raw_test.go similarity index 98% rename from server/azure/azuresql/managedinstance_raw_test.go rename to server/azure/sql/managedinstance_raw_test.go index 29cfd440..21e41531 100644 --- a/server/azure/azuresql/managedinstance_raw_test.go +++ b/server/azure/sql/managedinstance_raw_test.go @@ -1,4 +1,4 @@ -package azuresql_test +package sql_test import ( "context" diff --git a/server/azure/azuresql/operations.go b/server/azure/sql/operations.go similarity index 99% rename from server/azure/azuresql/operations.go rename to server/azure/sql/operations.go index befc5974..53eb4418 100644 --- a/server/azure/azuresql/operations.go +++ b/server/azure/sql/operations.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "context" diff --git a/server/azure/azuresql/sdk_roundtrip_test.go b/server/azure/sql/sdk_roundtrip_test.go similarity index 99% rename from server/azure/azuresql/sdk_roundtrip_test.go rename to server/azure/sql/sdk_roundtrip_test.go index 867f308c..be730dec 100644 --- a/server/azure/azuresql/sdk_roundtrip_test.go +++ b/server/azure/sql/sdk_roundtrip_test.go @@ -1,4 +1,4 @@ -package azuresql_test +package sql_test import ( "context" diff --git a/server/azure/azuresql/subresources.go b/server/azure/sql/subresources.go similarity index 99% rename from server/azure/azuresql/subresources.go rename to server/azure/sql/subresources.go index 9cc731c9..8c998761 100644 --- a/server/azure/azuresql/subresources.go +++ b/server/azure/sql/subresources.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "net/http" diff --git a/server/azure/azuresql/subresources_sdk_test.go b/server/azure/sql/subresources_sdk_test.go similarity index 99% rename from server/azure/azuresql/subresources_sdk_test.go rename to server/azure/sql/subresources_sdk_test.go index 24f4ec1b..6bb4dc32 100644 --- a/server/azure/azuresql/subresources_sdk_test.go +++ b/server/azure/sql/subresources_sdk_test.go @@ -1,4 +1,4 @@ -package azuresql_test +package sql_test import ( "context" diff --git a/server/azure/azuresql/types.go b/server/azure/sql/types.go similarity index 99% rename from server/azure/azuresql/types.go rename to server/azure/sql/types.go index bc645b4d..cb606b5e 100644 --- a/server/azure/azuresql/types.go +++ b/server/azure/sql/types.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "github.com/stackshy/cloudemu/v2/server/wire/azurearm" From c289ea0fa725c8b63706a0fb7bb52798c6fa5d3a Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 02:51:22 +0530 Subject: [PATCH 04/15] refactor: rename smashed multi-word filenames to snake_case (#325) Feature files use snake_case full words across layers (transit_gateway.go, traffic_mirror.go, prefix_list.go, route_table.go, elastic_ip.go, ...); renamed service main files to match their new package (cache.go, sql.go, ...). File renames only; no code or import changes. --- providers/azure/ai/{azureai.go => ai.go} | 0 providers/azure/cache/{azurecache.go => cache.go} | 0 providers/azure/cache/{azurecache_test.go => cache_test.go} | 0 providers/azure/search/{azuresearch.go => search.go} | 0 providers/azure/sql/{azuresql.go => sql.go} | 0 providers/azure/sql/{azuresql_test.go => sql_test.go} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename providers/azure/ai/{azureai.go => ai.go} (100%) rename providers/azure/cache/{azurecache.go => cache.go} (100%) rename providers/azure/cache/{azurecache_test.go => cache_test.go} (100%) rename providers/azure/search/{azuresearch.go => search.go} (100%) rename providers/azure/sql/{azuresql.go => sql.go} (100%) rename providers/azure/sql/{azuresql_test.go => sql_test.go} (100%) diff --git a/providers/azure/ai/azureai.go b/providers/azure/ai/ai.go similarity index 100% rename from providers/azure/ai/azureai.go rename to providers/azure/ai/ai.go diff --git a/providers/azure/cache/azurecache.go b/providers/azure/cache/cache.go similarity index 100% rename from providers/azure/cache/azurecache.go rename to providers/azure/cache/cache.go diff --git a/providers/azure/cache/azurecache_test.go b/providers/azure/cache/cache_test.go similarity index 100% rename from providers/azure/cache/azurecache_test.go rename to providers/azure/cache/cache_test.go diff --git a/providers/azure/search/azuresearch.go b/providers/azure/search/search.go similarity index 100% rename from providers/azure/search/azuresearch.go rename to providers/azure/search/search.go diff --git a/providers/azure/sql/azuresql.go b/providers/azure/sql/sql.go similarity index 100% rename from providers/azure/sql/azuresql.go rename to providers/azure/sql/sql.go diff --git a/providers/azure/sql/azuresql_test.go b/providers/azure/sql/sql_test.go similarity index 100% rename from providers/azure/sql/azuresql_test.go rename to providers/azure/sql/sql_test.go From b061970b57fa8e8183cfdb6b9fa4c44837cf4e84 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 02:52:27 +0530 Subject: [PATCH 05/15] ci: add Structure check enforcing docs/STRUCTURE.md naming (#325) --- .github/workflows/ci.yml | 8 ++++++++ scripts/check_structure.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 scripts/check_structure.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41083f36..bf7f2887 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,6 +107,14 @@ jobs: go mod tidy git diff --exit-code go.mod go.sum + structure: + name: Structure + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: naming & layout convention (docs/STRUCTURE.md) + run: bash scripts/check_structure.sh + format: name: Format runs-on: ubuntu-latest diff --git a/scripts/check_structure.sh b/scripts/check_structure.sh new file mode 100755 index 00000000..22e30590 --- /dev/null +++ b/scripts/check_structure.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# +# Enforces the repository structure convention documented in docs/STRUCTURE.md. +# Currently checks the unambiguous, deterministic rule: no provider or wire +# directory carries a redundant cloud prefix (the parent aws/azure/gcp already +# encodes the cloud). Run from the repo root. +set -euo pipefail + +fail=0 + +for cloud in aws azure gcp; do + for layer in providers server; do + dir="$layer/$cloud" + [ -d "$dir" ] || continue + for path in "$dir"/*/; do + [ -d "$path" ] || continue + name="$(basename "$path")" + case "$name" in + "$cloud"?*) + echo "structure: '$dir/$name' has a redundant '$cloud' prefix — drop it (see docs/STRUCTURE.md §2.2)" + fail=1 + ;; + esac + done + done +done + +if [ "$fail" -ne 0 ]; then + echo "" + echo "Structure check failed. See docs/STRUCTURE.md for the naming convention." + exit 1 +fi + +echo "structure: no cloud-prefixed provider/wire directories — OK" From e49f247ee1836858d8cc62346c04471d0ed91e04 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 02:52:41 +0530 Subject: [PATCH 06/15] docs: link Structure & Naming convention from the docs index (#325) --- docs/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/README.md b/docs/README.md index 7525cfd7..050b9fb0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,6 +5,7 @@ CloudEmu is a zero-cost, in-memory cloud emulation library for Go. It provides m ## Table of Contents - [Architecture](architecture.md) -- Three-layer design, package structure, cross-service wiring +- [Structure & Naming](STRUCTURE.md) -- Canonical service names, file-naming rule, per-directory layout, and where new code goes - [Services](services.md) -- Complete provider resource reference with all operations across every supported service - [Features](features.md) -- Cross-cutting features: auto-metrics, alarm evaluation, IAM policy checking, FIFO dedup, cost tracking, and more - [SDK Server](sdk-server.md) -- SDK-compatible HTTP server (use the real aws-sdk-go-v2 against CloudEmu) From 5c322584312ec65cc683d5dacea7620eb4d84115 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 02:59:04 +0530 Subject: [PATCH 07/15] refactor: snake_case feature filenames across provider & wire layers (#325) Renames the remaining smashed multi-word feature files to snake_case full words (nat_gateway, internet_gateway, elastic_ip, network_interface, transit_gateway, route_table, parameter_group, subnet_group, read_replica, managed_instance, app_service_plan, ...), and fixes import ordering after the directory renames. File/import-ordering changes only; no behavior change. --- providers/aws/aws.go | 2 +- .../bedrock/{asyncinvoke.go => async_invoke.go} | 0 .../{datasources.go => data_sources.go} | 0 .../{knowledgebases.go => knowledge_bases.go} | 0 .../aws/ecr/{repopolicy.go => repo_policy.go} | 0 ...tainerinstances.go => container_instances.go} | 0 ...{replicationgroup.go => replication_group.go} | 0 .../{subnetgroup.go => subnet_group.go} | 0 .../iam/{managedpolicy.go => managed_policy.go} | 0 ...agedpolicy_test.go => managed_policy_test.go} | 0 .../aws/iam/{rolepolicy.go => role_policy.go} | 0 .../memorydb/{multiregion.go => multi_region.go} | 0 .../{parametergroups.go => parameter_groups.go} | 0 .../{reservednodes.go => reserved_nodes.go} | 0 .../{serviceupdates.go => service_updates.go} | 0 .../{subnetgroups.go => subnet_groups.go} | 0 .../{advancedrestore.go => advanced_restore.go} | 0 ...drestore_test.go => advanced_restore_test.go} | 0 .../aws/rds/{optiongroup.go => option_group.go} | 0 ...{optiongroup_test.go => option_group_test.go} | 0 .../{parametergroup.go => parameter_group.go} | 0 ...etergroup_test.go => parameter_group_test.go} | 0 .../aws/rds/{readreplica.go => read_replica.go} | 0 ...{readreplica_test.go => read_replica_test.go} | 0 .../aws/rds/{subnetgroup.go => subnet_group.go} | 0 .../route53/{healthcheck.go => health_check.go} | 0 .../{featurestore.go => feature_store.go} | 0 .../aws/ssm/{publicparam.go => public_param.go} | 0 ...{publicparam_test.go => public_param_test.go} | 0 .../aws/ssm/{runcommand.go => run_command.go} | 0 .../aws/vpc/{clientvpn.go => client_vpn.go} | 0 .../aws/vpc/{dhcpoptions.go => dhcp_options.go} | 0 ...nlyigw.go => egress_only_internet_gateway.go} | 0 providers/aws/vpc/{eip.go => elastic_ip.go} | 0 .../{endpointservice.go => endpoint_service.go} | 0 .../aws/vpc/{igw.go => internet_gateway.go} | 0 providers/aws/vpc/{natgw.go => nat_gateway.go} | 0 .../{networkinsights.go => network_insights.go} | 0 .../aws/vpc/{eni.go => network_interface.go} | 0 .../aws/vpc/{prefixlist.go => prefix_list.go} | 0 .../aws/vpc/{routetable.go => route_table.go} | 0 .../vpc/{trafficmirror.go => traffic_mirror.go} | 0 .../{transitgateway.go => transit_gateway.go} | 0 .../vpc/{vpcattribute.go => vpc_attribute.go} | 0 ...pcattribute_test.go => vpc_attribute_test.go} | 0 ...ublicaccess.go => vpc_block_public_access.go} | 0 ...ognitiveservices.go => cognitive_services.go} | 0 .../{machinelearning.go => machine_learning.go} | 0 providers/azure/azure.go | 16 ++++++++-------- .../{firewallrules.go => firewall_rules.go} | 0 ...{privateendpoints.go => private_endpoints.go} | 0 .../dns/{healthcheck.go => health_check.go} | 0 .../{appserviceplan.go => app_service_plan.go} | 0 ...viceplan_test.go => app_service_plan_test.go} | 0 .../{datacenters.go => data_centers.go} | 0 .../{managedinstance.go => managed_instance.go} | 0 providers/azure/vnet/{eip.go => elastic_ip.go} | 0 .../azure/vnet/{igw.go => internet_gateway.go} | 0 .../azure/vnet/{natgw.go => nat_gateway.go} | 0 .../azure/vnet/{routetable.go => route_table.go} | 0 .../bigtable/{appprofiles.go => app_profiles.go} | 0 .../clouddns/{healthcheck.go => health_check.go} | 0 providers/gcp/gcp.go | 6 +++--- .../{featurestore.go => feature_store.go} | 0 .../{vectorsearch.go => vector_search.go} | 0 providers/gcp/vpc/{eip.go => elastic_ip.go} | 0 .../gcp/vpc/{igw.go => internet_gateway.go} | 0 providers/gcp/vpc/{natgw.go => nat_gateway.go} | 0 .../gcp/vpc/{routetable.go => route_table.go} | 0 .../bedrock/{asyncinvoke.go => async_invoke.go} | 0 .../{knowledgebases.go => knowledge_bases.go} | 0 .../{eventstream.go => event_stream.go} | 0 ...{availabilityzone.go => availability_zone.go} | 0 server/aws/ecr/{repopolicy.go => repo_policy.go} | 0 ...tainerinstances.go => container_instances.go} | 0 ...{replicationgroup.go => replication_group.go} | 0 .../{subnetgroup.go => subnet_group.go} | 0 ...romprovider_test.go => from_provider_test.go} | 0 server/aws/iam/{rolepolicy.go => role_policy.go} | 0 .../{parametergroups.go => parameter_groups.go} | 0 .../{subnetgroups.go => subnet_groups.go} | 0 .../{advancedrestore.go => advanced_restore.go} | 0 .../aws/rds/{optiongroup.go => option_group.go} | 0 .../{parametergroup.go => parameter_group.go} | 0 .../aws/rds/{readreplica.go => read_replica.go} | 0 .../aws/rds/{subnetgroup.go => subnet_group.go} | 0 .../{parametergroup.go => parameter_group.go} | 0 .../{featurestore.go => feature_store.go} | 0 server/aws/ssm/{runcommand.go => run_command.go} | 0 .../{machinelearning.go => machine_learning.go} | 0 server/azure/azure.go | 6 +++--- .../{firewallrules.go => firewall_rules.go} | 0 ...{privateendpoints.go => private_endpoints.go} | 0 ...xternallocations.go => external_locations.go} | 0 ...ragecredentials.go => storage_credentials.go} | 0 .../azure/{fromprovider.go => from_provider.go} | 0 ...romprovider_test.go => from_provider_test.go} | 0 .../{datacenters.go => data_centers.go} | 0 .../{managedinstance.go => managed_instance.go} | 0 .../bigtable/{appprofiles.go => app_profiles.go} | 0 server/gcp/{fromprovider.go => from_provider.go} | 0 ...romprovider_test.go => from_provider_test.go} | 0 .../{cachedcontents.go => cached_contents.go} | 0 .../{featureregistry.go => feature_registry.go} | 0 .../{featurestore.go => feature_store.go} | 0 .../{vectorsearch.go => vector_search.go} | 0 106 files changed, 15 insertions(+), 15 deletions(-) rename providers/aws/bedrock/{asyncinvoke.go => async_invoke.go} (100%) rename providers/aws/bedrockagent/{datasources.go => data_sources.go} (100%) rename providers/aws/bedrockagent/{knowledgebases.go => knowledge_bases.go} (100%) rename providers/aws/ecr/{repopolicy.go => repo_policy.go} (100%) rename providers/aws/ecs/{containerinstances.go => container_instances.go} (100%) rename providers/aws/elasticache/{replicationgroup.go => replication_group.go} (100%) rename providers/aws/elasticache/{subnetgroup.go => subnet_group.go} (100%) rename providers/aws/iam/{managedpolicy.go => managed_policy.go} (100%) rename providers/aws/iam/{managedpolicy_test.go => managed_policy_test.go} (100%) rename providers/aws/iam/{rolepolicy.go => role_policy.go} (100%) rename providers/aws/memorydb/{multiregion.go => multi_region.go} (100%) rename providers/aws/memorydb/{parametergroups.go => parameter_groups.go} (100%) rename providers/aws/memorydb/{reservednodes.go => reserved_nodes.go} (100%) rename providers/aws/memorydb/{serviceupdates.go => service_updates.go} (100%) rename providers/aws/memorydb/{subnetgroups.go => subnet_groups.go} (100%) rename providers/aws/rds/{advancedrestore.go => advanced_restore.go} (100%) rename providers/aws/rds/{advancedrestore_test.go => advanced_restore_test.go} (100%) rename providers/aws/rds/{optiongroup.go => option_group.go} (100%) rename providers/aws/rds/{optiongroup_test.go => option_group_test.go} (100%) rename providers/aws/rds/{parametergroup.go => parameter_group.go} (100%) rename providers/aws/rds/{parametergroup_test.go => parameter_group_test.go} (100%) rename providers/aws/rds/{readreplica.go => read_replica.go} (100%) rename providers/aws/rds/{readreplica_test.go => read_replica_test.go} (100%) rename providers/aws/rds/{subnetgroup.go => subnet_group.go} (100%) rename providers/aws/route53/{healthcheck.go => health_check.go} (100%) rename providers/aws/sagemaker/{featurestore.go => feature_store.go} (100%) rename providers/aws/ssm/{publicparam.go => public_param.go} (100%) rename providers/aws/ssm/{publicparam_test.go => public_param_test.go} (100%) rename providers/aws/ssm/{runcommand.go => run_command.go} (100%) rename providers/aws/vpc/{clientvpn.go => client_vpn.go} (100%) rename providers/aws/vpc/{dhcpoptions.go => dhcp_options.go} (100%) rename providers/aws/vpc/{egressonlyigw.go => egress_only_internet_gateway.go} (100%) rename providers/aws/vpc/{eip.go => elastic_ip.go} (100%) rename providers/aws/vpc/{endpointservice.go => endpoint_service.go} (100%) rename providers/aws/vpc/{igw.go => internet_gateway.go} (100%) rename providers/aws/vpc/{natgw.go => nat_gateway.go} (100%) rename providers/aws/vpc/{networkinsights.go => network_insights.go} (100%) rename providers/aws/vpc/{eni.go => network_interface.go} (100%) rename providers/aws/vpc/{prefixlist.go => prefix_list.go} (100%) rename providers/aws/vpc/{routetable.go => route_table.go} (100%) rename providers/aws/vpc/{trafficmirror.go => traffic_mirror.go} (100%) rename providers/aws/vpc/{transitgateway.go => transit_gateway.go} (100%) rename providers/aws/vpc/{vpcattribute.go => vpc_attribute.go} (100%) rename providers/aws/vpc/{vpcattribute_test.go => vpc_attribute_test.go} (100%) rename providers/aws/vpc/{vpcblockpublicaccess.go => vpc_block_public_access.go} (100%) rename providers/azure/ai/{cognitiveservices.go => cognitive_services.go} (100%) rename providers/azure/ai/{machinelearning.go => machine_learning.go} (100%) rename providers/azure/cosmospostgresql/{firewallrules.go => firewall_rules.go} (100%) rename providers/azure/cosmospostgresql/{privateendpoints.go => private_endpoints.go} (100%) rename providers/azure/dns/{healthcheck.go => health_check.go} (100%) rename providers/azure/functions/{appserviceplan.go => app_service_plan.go} (100%) rename providers/azure/functions/{appserviceplan_test.go => app_service_plan_test.go} (100%) rename providers/azure/managedcassandra/{datacenters.go => data_centers.go} (100%) rename providers/azure/sql/{managedinstance.go => managed_instance.go} (100%) rename providers/azure/vnet/{eip.go => elastic_ip.go} (100%) rename providers/azure/vnet/{igw.go => internet_gateway.go} (100%) rename providers/azure/vnet/{natgw.go => nat_gateway.go} (100%) rename providers/azure/vnet/{routetable.go => route_table.go} (100%) rename providers/gcp/bigtable/{appprofiles.go => app_profiles.go} (100%) rename providers/gcp/clouddns/{healthcheck.go => health_check.go} (100%) rename providers/gcp/vertexai/{featurestore.go => feature_store.go} (100%) rename providers/gcp/vertexai/{vectorsearch.go => vector_search.go} (100%) rename providers/gcp/vpc/{eip.go => elastic_ip.go} (100%) rename providers/gcp/vpc/{igw.go => internet_gateway.go} (100%) rename providers/gcp/vpc/{natgw.go => nat_gateway.go} (100%) rename providers/gcp/vpc/{routetable.go => route_table.go} (100%) rename server/aws/bedrock/{asyncinvoke.go => async_invoke.go} (100%) rename server/aws/bedrockagent/{knowledgebases.go => knowledge_bases.go} (100%) rename server/aws/bedrockagentruntime/{eventstream.go => event_stream.go} (100%) rename server/aws/ec2/{availabilityzone.go => availability_zone.go} (100%) rename server/aws/ecr/{repopolicy.go => repo_policy.go} (100%) rename server/aws/ecs/{containerinstances.go => container_instances.go} (100%) rename server/aws/elasticache/{replicationgroup.go => replication_group.go} (100%) rename server/aws/elasticache/{subnetgroup.go => subnet_group.go} (100%) rename server/aws/{fromprovider_test.go => from_provider_test.go} (100%) rename server/aws/iam/{rolepolicy.go => role_policy.go} (100%) rename server/aws/memorydb/{parametergroups.go => parameter_groups.go} (100%) rename server/aws/memorydb/{subnetgroups.go => subnet_groups.go} (100%) rename server/aws/rds/{advancedrestore.go => advanced_restore.go} (100%) rename server/aws/rds/{optiongroup.go => option_group.go} (100%) rename server/aws/rds/{parametergroup.go => parameter_group.go} (100%) rename server/aws/rds/{readreplica.go => read_replica.go} (100%) rename server/aws/rds/{subnetgroup.go => subnet_group.go} (100%) rename server/aws/redshift/{parametergroup.go => parameter_group.go} (100%) rename server/aws/sagemaker/{featurestore.go => feature_store.go} (100%) rename server/aws/ssm/{runcommand.go => run_command.go} (100%) rename server/azure/ai/{machinelearning.go => machine_learning.go} (100%) rename server/azure/cosmospostgresql/{firewallrules.go => firewall_rules.go} (100%) rename server/azure/cosmospostgresql/{privateendpoints.go => private_endpoints.go} (100%) rename server/azure/databricks/ucstorage/{externallocations.go => external_locations.go} (100%) rename server/azure/databricks/ucstorage/{storagecredentials.go => storage_credentials.go} (100%) rename server/azure/{fromprovider.go => from_provider.go} (100%) rename server/azure/{fromprovider_test.go => from_provider_test.go} (100%) rename server/azure/managedcassandra/{datacenters.go => data_centers.go} (100%) rename server/azure/sql/{managedinstance.go => managed_instance.go} (100%) rename server/gcp/bigtable/{appprofiles.go => app_profiles.go} (100%) rename server/gcp/{fromprovider.go => from_provider.go} (100%) rename server/gcp/{fromprovider_test.go => from_provider_test.go} (100%) rename server/gcp/vertexai/{cachedcontents.go => cached_contents.go} (100%) rename server/gcp/vertexai/{featureregistry.go => feature_registry.go} (100%) rename server/gcp/vertexai/{featurestore.go => feature_store.go} (100%) rename server/gcp/vertexai/{vectorsearch.go => vector_search.go} (100%) diff --git a/providers/aws/aws.go b/providers/aws/aws.go index 7c49e0a2..1bce5a4a 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -7,7 +7,6 @@ import ( "github.com/stackshy/cloudemu/v2/config" cerrors "github.com/stackshy/cloudemu/v2/errors" - "github.com/stackshy/cloudemu/v2/providers/aws/iam" "github.com/stackshy/cloudemu/v2/providers/aws/bedrock" "github.com/stackshy/cloudemu/v2/providers/aws/bedrockagent" "github.com/stackshy/cloudemu/v2/providers/aws/bedrockagentruntime" @@ -22,6 +21,7 @@ import ( "github.com/stackshy/cloudemu/v2/providers/aws/elasticache" "github.com/stackshy/cloudemu/v2/providers/aws/elb" "github.com/stackshy/cloudemu/v2/providers/aws/eventbridge" + "github.com/stackshy/cloudemu/v2/providers/aws/iam" "github.com/stackshy/cloudemu/v2/providers/aws/keyspaces" "github.com/stackshy/cloudemu/v2/providers/aws/lambda" "github.com/stackshy/cloudemu/v2/providers/aws/memorydb" diff --git a/providers/aws/bedrock/asyncinvoke.go b/providers/aws/bedrock/async_invoke.go similarity index 100% rename from providers/aws/bedrock/asyncinvoke.go rename to providers/aws/bedrock/async_invoke.go diff --git a/providers/aws/bedrockagent/datasources.go b/providers/aws/bedrockagent/data_sources.go similarity index 100% rename from providers/aws/bedrockagent/datasources.go rename to providers/aws/bedrockagent/data_sources.go diff --git a/providers/aws/bedrockagent/knowledgebases.go b/providers/aws/bedrockagent/knowledge_bases.go similarity index 100% rename from providers/aws/bedrockagent/knowledgebases.go rename to providers/aws/bedrockagent/knowledge_bases.go diff --git a/providers/aws/ecr/repopolicy.go b/providers/aws/ecr/repo_policy.go similarity index 100% rename from providers/aws/ecr/repopolicy.go rename to providers/aws/ecr/repo_policy.go diff --git a/providers/aws/ecs/containerinstances.go b/providers/aws/ecs/container_instances.go similarity index 100% rename from providers/aws/ecs/containerinstances.go rename to providers/aws/ecs/container_instances.go diff --git a/providers/aws/elasticache/replicationgroup.go b/providers/aws/elasticache/replication_group.go similarity index 100% rename from providers/aws/elasticache/replicationgroup.go rename to providers/aws/elasticache/replication_group.go diff --git a/providers/aws/elasticache/subnetgroup.go b/providers/aws/elasticache/subnet_group.go similarity index 100% rename from providers/aws/elasticache/subnetgroup.go rename to providers/aws/elasticache/subnet_group.go diff --git a/providers/aws/iam/managedpolicy.go b/providers/aws/iam/managed_policy.go similarity index 100% rename from providers/aws/iam/managedpolicy.go rename to providers/aws/iam/managed_policy.go diff --git a/providers/aws/iam/managedpolicy_test.go b/providers/aws/iam/managed_policy_test.go similarity index 100% rename from providers/aws/iam/managedpolicy_test.go rename to providers/aws/iam/managed_policy_test.go diff --git a/providers/aws/iam/rolepolicy.go b/providers/aws/iam/role_policy.go similarity index 100% rename from providers/aws/iam/rolepolicy.go rename to providers/aws/iam/role_policy.go diff --git a/providers/aws/memorydb/multiregion.go b/providers/aws/memorydb/multi_region.go similarity index 100% rename from providers/aws/memorydb/multiregion.go rename to providers/aws/memorydb/multi_region.go diff --git a/providers/aws/memorydb/parametergroups.go b/providers/aws/memorydb/parameter_groups.go similarity index 100% rename from providers/aws/memorydb/parametergroups.go rename to providers/aws/memorydb/parameter_groups.go diff --git a/providers/aws/memorydb/reservednodes.go b/providers/aws/memorydb/reserved_nodes.go similarity index 100% rename from providers/aws/memorydb/reservednodes.go rename to providers/aws/memorydb/reserved_nodes.go diff --git a/providers/aws/memorydb/serviceupdates.go b/providers/aws/memorydb/service_updates.go similarity index 100% rename from providers/aws/memorydb/serviceupdates.go rename to providers/aws/memorydb/service_updates.go diff --git a/providers/aws/memorydb/subnetgroups.go b/providers/aws/memorydb/subnet_groups.go similarity index 100% rename from providers/aws/memorydb/subnetgroups.go rename to providers/aws/memorydb/subnet_groups.go diff --git a/providers/aws/rds/advancedrestore.go b/providers/aws/rds/advanced_restore.go similarity index 100% rename from providers/aws/rds/advancedrestore.go rename to providers/aws/rds/advanced_restore.go diff --git a/providers/aws/rds/advancedrestore_test.go b/providers/aws/rds/advanced_restore_test.go similarity index 100% rename from providers/aws/rds/advancedrestore_test.go rename to providers/aws/rds/advanced_restore_test.go diff --git a/providers/aws/rds/optiongroup.go b/providers/aws/rds/option_group.go similarity index 100% rename from providers/aws/rds/optiongroup.go rename to providers/aws/rds/option_group.go diff --git a/providers/aws/rds/optiongroup_test.go b/providers/aws/rds/option_group_test.go similarity index 100% rename from providers/aws/rds/optiongroup_test.go rename to providers/aws/rds/option_group_test.go diff --git a/providers/aws/rds/parametergroup.go b/providers/aws/rds/parameter_group.go similarity index 100% rename from providers/aws/rds/parametergroup.go rename to providers/aws/rds/parameter_group.go diff --git a/providers/aws/rds/parametergroup_test.go b/providers/aws/rds/parameter_group_test.go similarity index 100% rename from providers/aws/rds/parametergroup_test.go rename to providers/aws/rds/parameter_group_test.go diff --git a/providers/aws/rds/readreplica.go b/providers/aws/rds/read_replica.go similarity index 100% rename from providers/aws/rds/readreplica.go rename to providers/aws/rds/read_replica.go diff --git a/providers/aws/rds/readreplica_test.go b/providers/aws/rds/read_replica_test.go similarity index 100% rename from providers/aws/rds/readreplica_test.go rename to providers/aws/rds/read_replica_test.go diff --git a/providers/aws/rds/subnetgroup.go b/providers/aws/rds/subnet_group.go similarity index 100% rename from providers/aws/rds/subnetgroup.go rename to providers/aws/rds/subnet_group.go diff --git a/providers/aws/route53/healthcheck.go b/providers/aws/route53/health_check.go similarity index 100% rename from providers/aws/route53/healthcheck.go rename to providers/aws/route53/health_check.go diff --git a/providers/aws/sagemaker/featurestore.go b/providers/aws/sagemaker/feature_store.go similarity index 100% rename from providers/aws/sagemaker/featurestore.go rename to providers/aws/sagemaker/feature_store.go diff --git a/providers/aws/ssm/publicparam.go b/providers/aws/ssm/public_param.go similarity index 100% rename from providers/aws/ssm/publicparam.go rename to providers/aws/ssm/public_param.go diff --git a/providers/aws/ssm/publicparam_test.go b/providers/aws/ssm/public_param_test.go similarity index 100% rename from providers/aws/ssm/publicparam_test.go rename to providers/aws/ssm/public_param_test.go diff --git a/providers/aws/ssm/runcommand.go b/providers/aws/ssm/run_command.go similarity index 100% rename from providers/aws/ssm/runcommand.go rename to providers/aws/ssm/run_command.go diff --git a/providers/aws/vpc/clientvpn.go b/providers/aws/vpc/client_vpn.go similarity index 100% rename from providers/aws/vpc/clientvpn.go rename to providers/aws/vpc/client_vpn.go diff --git a/providers/aws/vpc/dhcpoptions.go b/providers/aws/vpc/dhcp_options.go similarity index 100% rename from providers/aws/vpc/dhcpoptions.go rename to providers/aws/vpc/dhcp_options.go diff --git a/providers/aws/vpc/egressonlyigw.go b/providers/aws/vpc/egress_only_internet_gateway.go similarity index 100% rename from providers/aws/vpc/egressonlyigw.go rename to providers/aws/vpc/egress_only_internet_gateway.go diff --git a/providers/aws/vpc/eip.go b/providers/aws/vpc/elastic_ip.go similarity index 100% rename from providers/aws/vpc/eip.go rename to providers/aws/vpc/elastic_ip.go diff --git a/providers/aws/vpc/endpointservice.go b/providers/aws/vpc/endpoint_service.go similarity index 100% rename from providers/aws/vpc/endpointservice.go rename to providers/aws/vpc/endpoint_service.go diff --git a/providers/aws/vpc/igw.go b/providers/aws/vpc/internet_gateway.go similarity index 100% rename from providers/aws/vpc/igw.go rename to providers/aws/vpc/internet_gateway.go diff --git a/providers/aws/vpc/natgw.go b/providers/aws/vpc/nat_gateway.go similarity index 100% rename from providers/aws/vpc/natgw.go rename to providers/aws/vpc/nat_gateway.go diff --git a/providers/aws/vpc/networkinsights.go b/providers/aws/vpc/network_insights.go similarity index 100% rename from providers/aws/vpc/networkinsights.go rename to providers/aws/vpc/network_insights.go diff --git a/providers/aws/vpc/eni.go b/providers/aws/vpc/network_interface.go similarity index 100% rename from providers/aws/vpc/eni.go rename to providers/aws/vpc/network_interface.go diff --git a/providers/aws/vpc/prefixlist.go b/providers/aws/vpc/prefix_list.go similarity index 100% rename from providers/aws/vpc/prefixlist.go rename to providers/aws/vpc/prefix_list.go diff --git a/providers/aws/vpc/routetable.go b/providers/aws/vpc/route_table.go similarity index 100% rename from providers/aws/vpc/routetable.go rename to providers/aws/vpc/route_table.go diff --git a/providers/aws/vpc/trafficmirror.go b/providers/aws/vpc/traffic_mirror.go similarity index 100% rename from providers/aws/vpc/trafficmirror.go rename to providers/aws/vpc/traffic_mirror.go diff --git a/providers/aws/vpc/transitgateway.go b/providers/aws/vpc/transit_gateway.go similarity index 100% rename from providers/aws/vpc/transitgateway.go rename to providers/aws/vpc/transit_gateway.go diff --git a/providers/aws/vpc/vpcattribute.go b/providers/aws/vpc/vpc_attribute.go similarity index 100% rename from providers/aws/vpc/vpcattribute.go rename to providers/aws/vpc/vpc_attribute.go diff --git a/providers/aws/vpc/vpcattribute_test.go b/providers/aws/vpc/vpc_attribute_test.go similarity index 100% rename from providers/aws/vpc/vpcattribute_test.go rename to providers/aws/vpc/vpc_attribute_test.go diff --git a/providers/aws/vpc/vpcblockpublicaccess.go b/providers/aws/vpc/vpc_block_public_access.go similarity index 100% rename from providers/aws/vpc/vpcblockpublicaccess.go rename to providers/aws/vpc/vpc_block_public_access.go diff --git a/providers/azure/ai/cognitiveservices.go b/providers/azure/ai/cognitive_services.go similarity index 100% rename from providers/azure/ai/cognitiveservices.go rename to providers/azure/ai/cognitive_services.go diff --git a/providers/azure/ai/machinelearning.go b/providers/azure/ai/machine_learning.go similarity index 100% rename from providers/azure/ai/machinelearning.go rename to providers/azure/ai/machine_learning.go diff --git a/providers/azure/azure.go b/providers/azure/azure.go index c7e86902..ee48a2ad 100644 --- a/providers/azure/azure.go +++ b/providers/azure/azure.go @@ -7,28 +7,28 @@ import ( "github.com/stackshy/cloudemu/v2/config" "github.com/stackshy/cloudemu/v2/providers/azure/acr" - "github.com/stackshy/cloudemu/v2/providers/azure/aks" "github.com/stackshy/cloudemu/v2/providers/azure/ai" - "github.com/stackshy/cloudemu/v2/providers/azure/cache" - "github.com/stackshy/cloudemu/v2/providers/azure/dns" - "github.com/stackshy/cloudemu/v2/providers/azure/iam" - "github.com/stackshy/cloudemu/v2/providers/azure/loadbalancer" - "github.com/stackshy/cloudemu/v2/providers/azure/monitor" - "github.com/stackshy/cloudemu/v2/providers/azure/search" - "github.com/stackshy/cloudemu/v2/providers/azure/sql" + "github.com/stackshy/cloudemu/v2/providers/azure/aks" "github.com/stackshy/cloudemu/v2/providers/azure/blobstorage" + "github.com/stackshy/cloudemu/v2/providers/azure/cache" "github.com/stackshy/cloudemu/v2/providers/azure/cosmosdb" "github.com/stackshy/cloudemu/v2/providers/azure/cosmospostgresql" "github.com/stackshy/cloudemu/v2/providers/azure/databricks" + "github.com/stackshy/cloudemu/v2/providers/azure/dns" "github.com/stackshy/cloudemu/v2/providers/azure/eventgrid" "github.com/stackshy/cloudemu/v2/providers/azure/functions" + "github.com/stackshy/cloudemu/v2/providers/azure/iam" "github.com/stackshy/cloudemu/v2/providers/azure/keyvault" + "github.com/stackshy/cloudemu/v2/providers/azure/loadbalancer" "github.com/stackshy/cloudemu/v2/providers/azure/loganalytics" "github.com/stackshy/cloudemu/v2/providers/azure/managedcassandra" + "github.com/stackshy/cloudemu/v2/providers/azure/monitor" "github.com/stackshy/cloudemu/v2/providers/azure/mysqlflex" "github.com/stackshy/cloudemu/v2/providers/azure/notificationhubs" "github.com/stackshy/cloudemu/v2/providers/azure/postgresflex" + "github.com/stackshy/cloudemu/v2/providers/azure/search" "github.com/stackshy/cloudemu/v2/providers/azure/servicebus" + "github.com/stackshy/cloudemu/v2/providers/azure/sql" "github.com/stackshy/cloudemu/v2/providers/azure/tablestorage" "github.com/stackshy/cloudemu/v2/providers/azure/virtualmachines" "github.com/stackshy/cloudemu/v2/providers/azure/vnet" diff --git a/providers/azure/cosmospostgresql/firewallrules.go b/providers/azure/cosmospostgresql/firewall_rules.go similarity index 100% rename from providers/azure/cosmospostgresql/firewallrules.go rename to providers/azure/cosmospostgresql/firewall_rules.go diff --git a/providers/azure/cosmospostgresql/privateendpoints.go b/providers/azure/cosmospostgresql/private_endpoints.go similarity index 100% rename from providers/azure/cosmospostgresql/privateendpoints.go rename to providers/azure/cosmospostgresql/private_endpoints.go diff --git a/providers/azure/dns/healthcheck.go b/providers/azure/dns/health_check.go similarity index 100% rename from providers/azure/dns/healthcheck.go rename to providers/azure/dns/health_check.go diff --git a/providers/azure/functions/appserviceplan.go b/providers/azure/functions/app_service_plan.go similarity index 100% rename from providers/azure/functions/appserviceplan.go rename to providers/azure/functions/app_service_plan.go diff --git a/providers/azure/functions/appserviceplan_test.go b/providers/azure/functions/app_service_plan_test.go similarity index 100% rename from providers/azure/functions/appserviceplan_test.go rename to providers/azure/functions/app_service_plan_test.go diff --git a/providers/azure/managedcassandra/datacenters.go b/providers/azure/managedcassandra/data_centers.go similarity index 100% rename from providers/azure/managedcassandra/datacenters.go rename to providers/azure/managedcassandra/data_centers.go diff --git a/providers/azure/sql/managedinstance.go b/providers/azure/sql/managed_instance.go similarity index 100% rename from providers/azure/sql/managedinstance.go rename to providers/azure/sql/managed_instance.go diff --git a/providers/azure/vnet/eip.go b/providers/azure/vnet/elastic_ip.go similarity index 100% rename from providers/azure/vnet/eip.go rename to providers/azure/vnet/elastic_ip.go diff --git a/providers/azure/vnet/igw.go b/providers/azure/vnet/internet_gateway.go similarity index 100% rename from providers/azure/vnet/igw.go rename to providers/azure/vnet/internet_gateway.go diff --git a/providers/azure/vnet/natgw.go b/providers/azure/vnet/nat_gateway.go similarity index 100% rename from providers/azure/vnet/natgw.go rename to providers/azure/vnet/nat_gateway.go diff --git a/providers/azure/vnet/routetable.go b/providers/azure/vnet/route_table.go similarity index 100% rename from providers/azure/vnet/routetable.go rename to providers/azure/vnet/route_table.go diff --git a/providers/gcp/bigtable/appprofiles.go b/providers/gcp/bigtable/app_profiles.go similarity index 100% rename from providers/gcp/bigtable/appprofiles.go rename to providers/gcp/bigtable/app_profiles.go diff --git a/providers/gcp/clouddns/healthcheck.go b/providers/gcp/clouddns/health_check.go similarity index 100% rename from providers/gcp/clouddns/healthcheck.go rename to providers/gcp/clouddns/health_check.go diff --git a/providers/gcp/gcp.go b/providers/gcp/gcp.go index a926e1a9..f899820f 100644 --- a/providers/gcp/gcp.go +++ b/providers/gcp/gcp.go @@ -17,15 +17,15 @@ import ( "github.com/stackshy/cloudemu/v2/providers/gcp/fcm" "github.com/stackshy/cloudemu/v2/providers/gcp/firestore" "github.com/stackshy/cloudemu/v2/providers/gcp/gce" - "github.com/stackshy/cloudemu/v2/providers/gcp/iam" - "github.com/stackshy/cloudemu/v2/providers/gcp/loadbalancer" - "github.com/stackshy/cloudemu/v2/providers/gcp/vpc" "github.com/stackshy/cloudemu/v2/providers/gcp/gcs" "github.com/stackshy/cloudemu/v2/providers/gcp/gke" + "github.com/stackshy/cloudemu/v2/providers/gcp/iam" + "github.com/stackshy/cloudemu/v2/providers/gcp/loadbalancer" "github.com/stackshy/cloudemu/v2/providers/gcp/memorystore" "github.com/stackshy/cloudemu/v2/providers/gcp/pubsub" "github.com/stackshy/cloudemu/v2/providers/gcp/secretmanager" "github.com/stackshy/cloudemu/v2/providers/gcp/vertexai" + "github.com/stackshy/cloudemu/v2/providers/gcp/vpc" "github.com/stackshy/cloudemu/v2/services/resourcediscovery" ) diff --git a/providers/gcp/vertexai/featurestore.go b/providers/gcp/vertexai/feature_store.go similarity index 100% rename from providers/gcp/vertexai/featurestore.go rename to providers/gcp/vertexai/feature_store.go diff --git a/providers/gcp/vertexai/vectorsearch.go b/providers/gcp/vertexai/vector_search.go similarity index 100% rename from providers/gcp/vertexai/vectorsearch.go rename to providers/gcp/vertexai/vector_search.go diff --git a/providers/gcp/vpc/eip.go b/providers/gcp/vpc/elastic_ip.go similarity index 100% rename from providers/gcp/vpc/eip.go rename to providers/gcp/vpc/elastic_ip.go diff --git a/providers/gcp/vpc/igw.go b/providers/gcp/vpc/internet_gateway.go similarity index 100% rename from providers/gcp/vpc/igw.go rename to providers/gcp/vpc/internet_gateway.go diff --git a/providers/gcp/vpc/natgw.go b/providers/gcp/vpc/nat_gateway.go similarity index 100% rename from providers/gcp/vpc/natgw.go rename to providers/gcp/vpc/nat_gateway.go diff --git a/providers/gcp/vpc/routetable.go b/providers/gcp/vpc/route_table.go similarity index 100% rename from providers/gcp/vpc/routetable.go rename to providers/gcp/vpc/route_table.go diff --git a/server/aws/bedrock/asyncinvoke.go b/server/aws/bedrock/async_invoke.go similarity index 100% rename from server/aws/bedrock/asyncinvoke.go rename to server/aws/bedrock/async_invoke.go diff --git a/server/aws/bedrockagent/knowledgebases.go b/server/aws/bedrockagent/knowledge_bases.go similarity index 100% rename from server/aws/bedrockagent/knowledgebases.go rename to server/aws/bedrockagent/knowledge_bases.go diff --git a/server/aws/bedrockagentruntime/eventstream.go b/server/aws/bedrockagentruntime/event_stream.go similarity index 100% rename from server/aws/bedrockagentruntime/eventstream.go rename to server/aws/bedrockagentruntime/event_stream.go diff --git a/server/aws/ec2/availabilityzone.go b/server/aws/ec2/availability_zone.go similarity index 100% rename from server/aws/ec2/availabilityzone.go rename to server/aws/ec2/availability_zone.go diff --git a/server/aws/ecr/repopolicy.go b/server/aws/ecr/repo_policy.go similarity index 100% rename from server/aws/ecr/repopolicy.go rename to server/aws/ecr/repo_policy.go diff --git a/server/aws/ecs/containerinstances.go b/server/aws/ecs/container_instances.go similarity index 100% rename from server/aws/ecs/containerinstances.go rename to server/aws/ecs/container_instances.go diff --git a/server/aws/elasticache/replicationgroup.go b/server/aws/elasticache/replication_group.go similarity index 100% rename from server/aws/elasticache/replicationgroup.go rename to server/aws/elasticache/replication_group.go diff --git a/server/aws/elasticache/subnetgroup.go b/server/aws/elasticache/subnet_group.go similarity index 100% rename from server/aws/elasticache/subnetgroup.go rename to server/aws/elasticache/subnet_group.go diff --git a/server/aws/fromprovider_test.go b/server/aws/from_provider_test.go similarity index 100% rename from server/aws/fromprovider_test.go rename to server/aws/from_provider_test.go diff --git a/server/aws/iam/rolepolicy.go b/server/aws/iam/role_policy.go similarity index 100% rename from server/aws/iam/rolepolicy.go rename to server/aws/iam/role_policy.go diff --git a/server/aws/memorydb/parametergroups.go b/server/aws/memorydb/parameter_groups.go similarity index 100% rename from server/aws/memorydb/parametergroups.go rename to server/aws/memorydb/parameter_groups.go diff --git a/server/aws/memorydb/subnetgroups.go b/server/aws/memorydb/subnet_groups.go similarity index 100% rename from server/aws/memorydb/subnetgroups.go rename to server/aws/memorydb/subnet_groups.go diff --git a/server/aws/rds/advancedrestore.go b/server/aws/rds/advanced_restore.go similarity index 100% rename from server/aws/rds/advancedrestore.go rename to server/aws/rds/advanced_restore.go diff --git a/server/aws/rds/optiongroup.go b/server/aws/rds/option_group.go similarity index 100% rename from server/aws/rds/optiongroup.go rename to server/aws/rds/option_group.go diff --git a/server/aws/rds/parametergroup.go b/server/aws/rds/parameter_group.go similarity index 100% rename from server/aws/rds/parametergroup.go rename to server/aws/rds/parameter_group.go diff --git a/server/aws/rds/readreplica.go b/server/aws/rds/read_replica.go similarity index 100% rename from server/aws/rds/readreplica.go rename to server/aws/rds/read_replica.go diff --git a/server/aws/rds/subnetgroup.go b/server/aws/rds/subnet_group.go similarity index 100% rename from server/aws/rds/subnetgroup.go rename to server/aws/rds/subnet_group.go diff --git a/server/aws/redshift/parametergroup.go b/server/aws/redshift/parameter_group.go similarity index 100% rename from server/aws/redshift/parametergroup.go rename to server/aws/redshift/parameter_group.go diff --git a/server/aws/sagemaker/featurestore.go b/server/aws/sagemaker/feature_store.go similarity index 100% rename from server/aws/sagemaker/featurestore.go rename to server/aws/sagemaker/feature_store.go diff --git a/server/aws/ssm/runcommand.go b/server/aws/ssm/run_command.go similarity index 100% rename from server/aws/ssm/runcommand.go rename to server/aws/ssm/run_command.go diff --git a/server/azure/ai/machinelearning.go b/server/azure/ai/machine_learning.go similarity index 100% rename from server/azure/ai/machinelearning.go rename to server/azure/ai/machine_learning.go diff --git a/server/azure/azure.go b/server/azure/azure.go index c5bd85ee..0e8d8980 100644 --- a/server/azure/azure.go +++ b/server/azure/azure.go @@ -9,10 +9,8 @@ package azure import ( "github.com/stackshy/cloudemu/v2/server" "github.com/stackshy/cloudemu/v2/server/azure/acr" - aksserver "github.com/stackshy/cloudemu/v2/server/azure/aks" azureaiserver "github.com/stackshy/cloudemu/v2/server/azure/ai" - azuresearchserver "github.com/stackshy/cloudemu/v2/server/azure/search" - "github.com/stackshy/cloudemu/v2/server/azure/sql" + aksserver "github.com/stackshy/cloudemu/v2/server/azure/aks" "github.com/stackshy/cloudemu/v2/server/azure/blob" cachesrv "github.com/stackshy/cloudemu/v2/server/azure/cache" "github.com/stackshy/cloudemu/v2/server/azure/cosmos" @@ -51,8 +49,10 @@ import ( "github.com/stackshy/cloudemu/v2/server/azure/queue" "github.com/stackshy/cloudemu/v2/server/azure/resourcegraph" "github.com/stackshy/cloudemu/v2/server/azure/resourcegroups" + azuresearchserver "github.com/stackshy/cloudemu/v2/server/azure/search" "github.com/stackshy/cloudemu/v2/server/azure/servicebus" "github.com/stackshy/cloudemu/v2/server/azure/snapshots" + "github.com/stackshy/cloudemu/v2/server/azure/sql" "github.com/stackshy/cloudemu/v2/server/azure/sshpublickeys" storageaccountsrv "github.com/stackshy/cloudemu/v2/server/azure/storageaccount" "github.com/stackshy/cloudemu/v2/server/azure/subscriptions" diff --git a/server/azure/cosmospostgresql/firewallrules.go b/server/azure/cosmospostgresql/firewall_rules.go similarity index 100% rename from server/azure/cosmospostgresql/firewallrules.go rename to server/azure/cosmospostgresql/firewall_rules.go diff --git a/server/azure/cosmospostgresql/privateendpoints.go b/server/azure/cosmospostgresql/private_endpoints.go similarity index 100% rename from server/azure/cosmospostgresql/privateendpoints.go rename to server/azure/cosmospostgresql/private_endpoints.go diff --git a/server/azure/databricks/ucstorage/externallocations.go b/server/azure/databricks/ucstorage/external_locations.go similarity index 100% rename from server/azure/databricks/ucstorage/externallocations.go rename to server/azure/databricks/ucstorage/external_locations.go diff --git a/server/azure/databricks/ucstorage/storagecredentials.go b/server/azure/databricks/ucstorage/storage_credentials.go similarity index 100% rename from server/azure/databricks/ucstorage/storagecredentials.go rename to server/azure/databricks/ucstorage/storage_credentials.go diff --git a/server/azure/fromprovider.go b/server/azure/from_provider.go similarity index 100% rename from server/azure/fromprovider.go rename to server/azure/from_provider.go diff --git a/server/azure/fromprovider_test.go b/server/azure/from_provider_test.go similarity index 100% rename from server/azure/fromprovider_test.go rename to server/azure/from_provider_test.go diff --git a/server/azure/managedcassandra/datacenters.go b/server/azure/managedcassandra/data_centers.go similarity index 100% rename from server/azure/managedcassandra/datacenters.go rename to server/azure/managedcassandra/data_centers.go diff --git a/server/azure/sql/managedinstance.go b/server/azure/sql/managed_instance.go similarity index 100% rename from server/azure/sql/managedinstance.go rename to server/azure/sql/managed_instance.go diff --git a/server/gcp/bigtable/appprofiles.go b/server/gcp/bigtable/app_profiles.go similarity index 100% rename from server/gcp/bigtable/appprofiles.go rename to server/gcp/bigtable/app_profiles.go diff --git a/server/gcp/fromprovider.go b/server/gcp/from_provider.go similarity index 100% rename from server/gcp/fromprovider.go rename to server/gcp/from_provider.go diff --git a/server/gcp/fromprovider_test.go b/server/gcp/from_provider_test.go similarity index 100% rename from server/gcp/fromprovider_test.go rename to server/gcp/from_provider_test.go diff --git a/server/gcp/vertexai/cachedcontents.go b/server/gcp/vertexai/cached_contents.go similarity index 100% rename from server/gcp/vertexai/cachedcontents.go rename to server/gcp/vertexai/cached_contents.go diff --git a/server/gcp/vertexai/featureregistry.go b/server/gcp/vertexai/feature_registry.go similarity index 100% rename from server/gcp/vertexai/featureregistry.go rename to server/gcp/vertexai/feature_registry.go diff --git a/server/gcp/vertexai/featurestore.go b/server/gcp/vertexai/feature_store.go similarity index 100% rename from server/gcp/vertexai/featurestore.go rename to server/gcp/vertexai/feature_store.go diff --git a/server/gcp/vertexai/vectorsearch.go b/server/gcp/vertexai/vector_search.go similarity index 100% rename from server/gcp/vertexai/vectorsearch.go rename to server/gcp/vertexai/vector_search.go From 326b74fc96ca9fb6113ea0361076defe3b7a6958 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 10:37:17 +0530 Subject: [PATCH 08/15] refactor(server): match wire dir names to their provider (#325) elbv2->elb; azure blob->blobstorage, cosmos->cosmosdb, table->tablestorage, network->vnet; gcp compute->gce, monitoring->cloudmonitoring, networks->vpc. Provider<->wire now share a name within each cloud. Rename-only. --- server/aws/aws.go | 4 ++-- server/aws/{elbv2 => elb}/attributes.go | 2 +- .../attributes_sdk_roundtrip_test.go | 2 +- server/aws/{elbv2 => elb}/handler.go | 4 ++-- server/aws/{elbv2 => elb}/operations.go | 2 +- server/aws/{elbv2 => elb}/sdk_roundtrip_test.go | 2 +- server/aws/{elbv2 => elb}/tags.go | 2 +- server/aws/{elbv2 => elb}/types.go | 2 +- server/azure/azure.go | 14 +++++++------- .../{blob => blobstorage}/blob_lifecycle_test.go | 2 +- server/azure/{blob => blobstorage}/blob_test.go | 2 +- server/azure/{blob => blobstorage}/handler.go | 4 ++-- server/azure/{blob => blobstorage}/types.go | 2 +- .../{cosmos => cosmosdb}/cosmos_lifecycle_test.go | 2 +- server/azure/{cosmos => cosmosdb}/cosmos_test.go | 2 +- server/azure/{cosmos => cosmosdb}/handler.go | 4 ++-- server/azure/{cosmos => cosmosdb}/types.go | 2 +- .../azure/{table => tablestorage}/fidelity_test.go | 2 +- server/azure/{table => tablestorage}/handler.go | 4 ++-- server/azure/{table => tablestorage}/helpers.go | 2 +- .../{table => tablestorage}/sdk_roundtrip_test.go | 2 +- server/azure/{network => vnet}/handler.go | 4 ++-- server/azure/{network => vnet}/network_test.go | 2 +- server/azure/{network => vnet}/types.go | 2 +- .../gcp/{monitoring => cloudmonitoring}/handler.go | 4 ++-- .../monitoring_test.go | 2 +- .../gcp/{monitoring => cloudmonitoring}/types.go | 2 +- server/gcp/{compute => gce}/compute_test.go | 2 +- server/gcp/{compute => gce}/disks.go | 2 +- server/gcp/{compute => gce}/disks_sdk_test.go | 2 +- server/gcp/{compute => gce}/handler.go | 4 ++-- server/gcp/{compute => gce}/images.go | 2 +- server/gcp/{compute => gce}/images_sdk_test.go | 2 +- server/gcp/{compute => gce}/instances.go | 2 +- server/gcp/{compute => gce}/sdk_roundtrip_test.go | 2 +- server/gcp/{compute => gce}/snapshots.go | 2 +- server/gcp/{compute => gce}/snapshots_sdk_test.go | 2 +- server/gcp/{compute => gce}/types.go | 2 +- server/gcp/gcp.go | 12 ++++++------ server/gcp/{networks => vpc}/addresses.go | 2 +- server/gcp/{networks => vpc}/handler.go | 4 ++-- server/gcp/{networks => vpc}/networks_test.go | 2 +- server/gcp/{networks => vpc}/routers.go | 2 +- server/gcp/{networks => vpc}/types.go | 2 +- 44 files changed, 64 insertions(+), 64 deletions(-) rename server/aws/{elbv2 => elb}/attributes.go (99%) rename server/aws/{elbv2 => elb}/attributes_sdk_roundtrip_test.go (99%) rename server/aws/{elbv2 => elb}/handler.go (98%) rename server/aws/{elbv2 => elb}/operations.go (99%) rename server/aws/{elbv2 => elb}/sdk_roundtrip_test.go (99%) rename server/aws/{elbv2 => elb}/tags.go (99%) rename server/aws/{elbv2 => elb}/types.go (99%) rename server/azure/{blob => blobstorage}/blob_lifecycle_test.go (99%) rename server/azure/{blob => blobstorage}/blob_test.go (99%) rename server/azure/{blob => blobstorage}/handler.go (99%) rename server/azure/{blob => blobstorage}/types.go (99%) rename server/azure/{cosmos => cosmosdb}/cosmos_lifecycle_test.go (99%) rename server/azure/{cosmos => cosmosdb}/cosmos_test.go (99%) rename server/azure/{cosmos => cosmosdb}/handler.go (99%) rename server/azure/{cosmos => cosmosdb}/types.go (99%) rename server/azure/{table => tablestorage}/fidelity_test.go (99%) rename server/azure/{table => tablestorage}/handler.go (99%) rename server/azure/{table => tablestorage}/helpers.go (99%) rename server/azure/{table => tablestorage}/sdk_roundtrip_test.go (99%) rename server/azure/{network => vnet}/handler.go (99%) rename server/azure/{network => vnet}/network_test.go (99%) rename server/azure/{network => vnet}/types.go (99%) rename server/gcp/{monitoring => cloudmonitoring}/handler.go (98%) rename server/gcp/{monitoring => cloudmonitoring}/monitoring_test.go (99%) rename server/gcp/{monitoring => cloudmonitoring}/types.go (98%) rename server/gcp/{compute => gce}/compute_test.go (99%) rename server/gcp/{compute => gce}/disks.go (99%) rename server/gcp/{compute => gce}/disks_sdk_test.go (99%) rename server/gcp/{compute => gce}/handler.go (98%) rename server/gcp/{compute => gce}/images.go (99%) rename server/gcp/{compute => gce}/images_sdk_test.go (99%) rename server/gcp/{compute => gce}/instances.go (99%) rename server/gcp/{compute => gce}/sdk_roundtrip_test.go (99%) rename server/gcp/{compute => gce}/snapshots.go (99%) rename server/gcp/{compute => gce}/snapshots_sdk_test.go (99%) rename server/gcp/{compute => gce}/types.go (99%) rename server/gcp/{networks => vpc}/addresses.go (99%) rename server/gcp/{networks => vpc}/handler.go (99%) rename server/gcp/{networks => vpc}/networks_test.go (99%) rename server/gcp/{networks => vpc}/routers.go (99%) rename server/gcp/{networks => vpc}/types.go (99%) diff --git a/server/aws/aws.go b/server/aws/aws.go index 3b0e6f24..6aaab29a 100644 --- a/server/aws/aws.go +++ b/server/aws/aws.go @@ -21,7 +21,7 @@ import ( ecssrv "github.com/stackshy/cloudemu/v2/server/aws/ecs" "github.com/stackshy/cloudemu/v2/server/aws/eks" "github.com/stackshy/cloudemu/v2/server/aws/elasticache" - "github.com/stackshy/cloudemu/v2/server/aws/elbv2" + "github.com/stackshy/cloudemu/v2/server/aws/elb" "github.com/stackshy/cloudemu/v2/server/aws/eventbridge" "github.com/stackshy/cloudemu/v2/server/aws/iam" keyspacessrv "github.com/stackshy/cloudemu/v2/server/aws/keyspaces" @@ -306,7 +306,7 @@ func New(d Drivers) *server.Server { // RDS, IAM, Redshift, and EC2. It must register before the EC2 catch-all so // the EC2 handler doesn't claim ELBv2 form bodies first. if d.ELB != nil { - srv.Register(elbv2.New(d.ELB)) + srv.Register(elb.New(d.ELB)) } // ElastiCache is another AWS query-protocol handler; register before the diff --git a/server/aws/elbv2/attributes.go b/server/aws/elb/attributes.go similarity index 99% rename from server/aws/elbv2/attributes.go rename to server/aws/elb/attributes.go index 7e0833cc..2e132e1e 100644 --- a/server/aws/elbv2/attributes.go +++ b/server/aws/elb/attributes.go @@ -1,4 +1,4 @@ -package elbv2 +package elb import ( "encoding/xml" diff --git a/server/aws/elbv2/attributes_sdk_roundtrip_test.go b/server/aws/elb/attributes_sdk_roundtrip_test.go similarity index 99% rename from server/aws/elbv2/attributes_sdk_roundtrip_test.go rename to server/aws/elb/attributes_sdk_roundtrip_test.go index aeaf4f7d..0aecbc38 100644 --- a/server/aws/elbv2/attributes_sdk_roundtrip_test.go +++ b/server/aws/elb/attributes_sdk_roundtrip_test.go @@ -1,4 +1,4 @@ -package elbv2_test +package elb_test import ( "context" diff --git a/server/aws/elbv2/handler.go b/server/aws/elb/handler.go similarity index 98% rename from server/aws/elbv2/handler.go rename to server/aws/elb/handler.go index 969011fe..057fc399 100644 --- a/server/aws/elbv2/handler.go +++ b/server/aws/elb/handler.go @@ -1,4 +1,4 @@ -// Package elbv2 implements the AWS Elastic Load Balancing v2 (ALB/NLB) +// Package elb implements the AWS Elastic Load Balancing v2 (ALB/NLB) // query-protocol as a server.Handler. Point the real aws-sdk-go-v2 // elasticloadbalancingv2 client at a Server registered with this handler and // LoadBalancer / TargetGroup / Listener / Rule / target-health operations work @@ -11,7 +11,7 @@ // other query-protocol actions, so this handler MUST register before EC2. Its // action set is disjoint from RDS/IAM/Redshift, so ordering relative to those // is unconstrained. -package elbv2 +package elb import ( "net/http" diff --git a/server/aws/elbv2/operations.go b/server/aws/elb/operations.go similarity index 99% rename from server/aws/elbv2/operations.go rename to server/aws/elb/operations.go index de78f6fd..04c48492 100644 --- a/server/aws/elbv2/operations.go +++ b/server/aws/elb/operations.go @@ -1,4 +1,4 @@ -package elbv2 +package elb import ( "net/http" diff --git a/server/aws/elbv2/sdk_roundtrip_test.go b/server/aws/elb/sdk_roundtrip_test.go similarity index 99% rename from server/aws/elbv2/sdk_roundtrip_test.go rename to server/aws/elb/sdk_roundtrip_test.go index 02e97fc8..f20f13a5 100644 --- a/server/aws/elbv2/sdk_roundtrip_test.go +++ b/server/aws/elb/sdk_roundtrip_test.go @@ -1,4 +1,4 @@ -package elbv2_test +package elb_test import ( "context" diff --git a/server/aws/elbv2/tags.go b/server/aws/elb/tags.go similarity index 99% rename from server/aws/elbv2/tags.go rename to server/aws/elb/tags.go index 076ea88d..c67e6b67 100644 --- a/server/aws/elbv2/tags.go +++ b/server/aws/elb/tags.go @@ -1,4 +1,4 @@ -package elbv2 +package elb import ( "context" diff --git a/server/aws/elbv2/types.go b/server/aws/elb/types.go similarity index 99% rename from server/aws/elbv2/types.go rename to server/aws/elb/types.go index 2df9354e..9891f5d1 100644 --- a/server/aws/elbv2/types.go +++ b/server/aws/elb/types.go @@ -1,4 +1,4 @@ -package elbv2 +package elb import ( "encoding/xml" diff --git a/server/azure/azure.go b/server/azure/azure.go index 0e8d8980..e22a9fd0 100644 --- a/server/azure/azure.go +++ b/server/azure/azure.go @@ -11,10 +11,10 @@ import ( "github.com/stackshy/cloudemu/v2/server/azure/acr" azureaiserver "github.com/stackshy/cloudemu/v2/server/azure/ai" aksserver "github.com/stackshy/cloudemu/v2/server/azure/aks" - "github.com/stackshy/cloudemu/v2/server/azure/blob" + "github.com/stackshy/cloudemu/v2/server/azure/blobstorage" cachesrv "github.com/stackshy/cloudemu/v2/server/azure/cache" - "github.com/stackshy/cloudemu/v2/server/azure/cosmos" "github.com/stackshy/cloudemu/v2/server/azure/cosmosaccount" + "github.com/stackshy/cloudemu/v2/server/azure/cosmosdb" "github.com/stackshy/cloudemu/v2/server/azure/cosmospostgresql" "github.com/stackshy/cloudemu/v2/server/azure/databricks" "github.com/stackshy/cloudemu/v2/server/azure/databricks/dbfs" @@ -43,7 +43,6 @@ import ( "github.com/stackshy/cloudemu/v2/server/azure/managedcassandra" "github.com/stackshy/cloudemu/v2/server/azure/monitor" "github.com/stackshy/cloudemu/v2/server/azure/mysqlflex" - "github.com/stackshy/cloudemu/v2/server/azure/network" notificationhubssrv "github.com/stackshy/cloudemu/v2/server/azure/notificationhubs" "github.com/stackshy/cloudemu/v2/server/azure/postgresflex" "github.com/stackshy/cloudemu/v2/server/azure/queue" @@ -56,8 +55,9 @@ import ( "github.com/stackshy/cloudemu/v2/server/azure/sshpublickeys" storageaccountsrv "github.com/stackshy/cloudemu/v2/server/azure/storageaccount" "github.com/stackshy/cloudemu/v2/server/azure/subscriptions" - tablesrv "github.com/stackshy/cloudemu/v2/server/azure/table" + tablesrv "github.com/stackshy/cloudemu/v2/server/azure/tablestorage" "github.com/stackshy/cloudemu/v2/server/azure/virtualmachines" + "github.com/stackshy/cloudemu/v2/server/azure/vnet" azureaidriver "github.com/stackshy/cloudemu/v2/services/azureai/driver" azuresearchdriver "github.com/stackshy/cloudemu/v2/services/azuresearch/driver" cachedriver "github.com/stackshy/cloudemu/v2/services/cache/driver" @@ -207,7 +207,7 @@ func New(d Drivers) *server.Server { // Cosmos DB matches on /dbs/* paths — register before the catch-all // blob handler. if d.CosmosDB != nil { - srv.Register(cosmos.New(d.CosmosDB)) + srv.Register(cosmosdb.New(d.CosmosDB)) // Cosmos-account ARM control plane (Microsoft.DocumentDB/databaseAccounts). // Claims only the /providers/Microsoft.DocumentDB/databaseAccounts/ // management path — disjoint from the /dbs data plane above and from @@ -226,7 +226,7 @@ func New(d Drivers) *server.Server { } if d.Network != nil { - srv.Register(network.New(d.Network)) + srv.Register(vnet.New(d.Network)) } // Azure DNS shares the Microsoft.Network ARM provider with the network @@ -417,7 +417,7 @@ func New(d Drivers) *server.Server { // must register last so its permissive Matches() doesn't shadow the // ARM-specific resource handlers. if d.BlobStorage != nil { - srv.Register(blob.New(d.BlobStorage)) + srv.Register(blobstorage.New(d.BlobStorage)) } return srv diff --git a/server/azure/blob/blob_lifecycle_test.go b/server/azure/blobstorage/blob_lifecycle_test.go similarity index 99% rename from server/azure/blob/blob_lifecycle_test.go rename to server/azure/blobstorage/blob_lifecycle_test.go index b677ac91..8257376d 100644 --- a/server/azure/blob/blob_lifecycle_test.go +++ b/server/azure/blobstorage/blob_lifecycle_test.go @@ -9,7 +9,7 @@ // x-ms-copy-source. Versioning, lifecycle, tags, leases, snapshots, and block // lists are driver-only and not exposed over HTTP, so they are not exercised // here. -package blob_test +package blobstorage_test import ( "bytes" diff --git a/server/azure/blob/blob_test.go b/server/azure/blobstorage/blob_test.go similarity index 99% rename from server/azure/blob/blob_test.go rename to server/azure/blobstorage/blob_test.go index 8fa997df..6aa64e91 100644 --- a/server/azure/blob/blob_test.go +++ b/server/azure/blobstorage/blob_test.go @@ -1,4 +1,4 @@ -package blob_test +package blobstorage_test import ( "bytes" diff --git a/server/azure/blob/handler.go b/server/azure/blobstorage/handler.go similarity index 99% rename from server/azure/blob/handler.go rename to server/azure/blobstorage/handler.go index 860398e7..d574fd8e 100644 --- a/server/azure/blob/handler.go +++ b/server/azure/blobstorage/handler.go @@ -1,4 +1,4 @@ -// Package blob implements the Azure Blob Storage REST+XML wire protocol as a +// Package blobstorage implements the Azure Blob Storage REST+XML wire protocol as a // server.Handler. Real azure-sdk-for-go azblob clients configured with a // custom service URL hit this handler the same way they hit // {account}.blob.core.windows.net. @@ -17,7 +17,7 @@ // // Less-used surfaces (lifecycle, encryption, tags, access policies, leases, // snapshots, versioning) are not yet wired and return 501. -package blob +package blobstorage import ( "crypto/sha256" diff --git a/server/azure/blob/types.go b/server/azure/blobstorage/types.go similarity index 99% rename from server/azure/blob/types.go rename to server/azure/blobstorage/types.go index 6662ae65..0a12e747 100644 --- a/server/azure/blob/types.go +++ b/server/azure/blobstorage/types.go @@ -1,4 +1,4 @@ -package blob +package blobstorage import "encoding/xml" diff --git a/server/azure/cosmos/cosmos_lifecycle_test.go b/server/azure/cosmosdb/cosmos_lifecycle_test.go similarity index 99% rename from server/azure/cosmos/cosmos_lifecycle_test.go rename to server/azure/cosmosdb/cosmos_lifecycle_test.go index e7bb470c..ae7014c2 100644 --- a/server/azure/cosmos/cosmos_lifecycle_test.go +++ b/server/azure/cosmosdb/cosmos_lifecycle_test.go @@ -19,7 +19,7 @@ // - Item identity is the partition-key value only, so two docs with the // same pk but different ids collide (real Cosmos keys on (pk, id)). // - PATCH (PatchItem) is not routed at all (405 MethodNotAllowed). -package cosmos_test +package cosmosdb_test import ( "context" diff --git a/server/azure/cosmos/cosmos_test.go b/server/azure/cosmosdb/cosmos_test.go similarity index 99% rename from server/azure/cosmos/cosmos_test.go rename to server/azure/cosmosdb/cosmos_test.go index 246ebf6d..26883ff4 100644 --- a/server/azure/cosmos/cosmos_test.go +++ b/server/azure/cosmosdb/cosmos_test.go @@ -1,4 +1,4 @@ -package cosmos_test +package cosmosdb_test import ( "context" diff --git a/server/azure/cosmos/handler.go b/server/azure/cosmosdb/handler.go similarity index 99% rename from server/azure/cosmos/handler.go rename to server/azure/cosmosdb/handler.go index 817e4d9a..f009deb6 100644 --- a/server/azure/cosmos/handler.go +++ b/server/azure/cosmosdb/handler.go @@ -1,4 +1,4 @@ -// Package cosmos implements the Azure Cosmos DB SQL data-plane REST API +// Package cosmosdb implements the Azure Cosmos DB SQL data-plane REST API // against a CloudEmu database driver. Real azure-sdk-for-go/sdk/data/azcosmos // clients configured with a custom endpoint hit this handler the same way // they hit {account}.documents.azure.com. @@ -14,7 +14,7 @@ // The driver doesn't model Cosmos's database-level grouping, so we expose a // single virtual database "cloudemu" that always exists and contains every // driver table as a container. -package cosmos +package cosmosdb import ( "encoding/json" diff --git a/server/azure/cosmos/types.go b/server/azure/cosmosdb/types.go similarity index 99% rename from server/azure/cosmos/types.go rename to server/azure/cosmosdb/types.go index 090d4a8f..27950737 100644 --- a/server/azure/cosmos/types.go +++ b/server/azure/cosmosdb/types.go @@ -1,4 +1,4 @@ -package cosmos +package cosmosdb // Cosmos DB SQL API JSON wire shapes. We model the minimum surface needed for // the azcosmos SDK to drive databases, containers, and items end-to-end. diff --git a/server/azure/table/fidelity_test.go b/server/azure/tablestorage/fidelity_test.go similarity index 99% rename from server/azure/table/fidelity_test.go rename to server/azure/tablestorage/fidelity_test.go index 28ab4333..c0c6d133 100644 --- a/server/azure/table/fidelity_test.go +++ b/server/azure/tablestorage/fidelity_test.go @@ -1,4 +1,4 @@ -package table_test +package tablestorage_test import ( "context" diff --git a/server/azure/table/handler.go b/server/azure/tablestorage/handler.go similarity index 99% rename from server/azure/table/handler.go rename to server/azure/tablestorage/handler.go index 745143f0..5adae4c5 100644 --- a/server/azure/table/handler.go +++ b/server/azure/tablestorage/handler.go @@ -1,4 +1,4 @@ -// Package table implements the Azure Table Storage data-plane REST protocol +// Package tablestorage implements the Azure Table Storage data-plane REST protocol // (OData/JSON) as a server.Handler. Real azure-sdk-for-go aztables clients // configured with a custom service URL hit this handler the same way they hit // {account}.table.core.windows.net. @@ -18,7 +18,7 @@ // Access policies and transactional batches are out of scope. Upsert (a PUT or // MERGE with no If-Match header against a missing row) is supported as an // insert-or-replace/merge, matching aztables UpsertEntity. -package table +package tablestorage import ( "encoding/json" diff --git a/server/azure/table/helpers.go b/server/azure/tablestorage/helpers.go similarity index 99% rename from server/azure/table/helpers.go rename to server/azure/tablestorage/helpers.go index ff498997..0c4ab130 100644 --- a/server/azure/table/helpers.go +++ b/server/azure/tablestorage/helpers.go @@ -1,4 +1,4 @@ -package table +package tablestorage import ( "encoding/json" diff --git a/server/azure/table/sdk_roundtrip_test.go b/server/azure/tablestorage/sdk_roundtrip_test.go similarity index 99% rename from server/azure/table/sdk_roundtrip_test.go rename to server/azure/tablestorage/sdk_roundtrip_test.go index 66083ef6..097dda6e 100644 --- a/server/azure/table/sdk_roundtrip_test.go +++ b/server/azure/tablestorage/sdk_roundtrip_test.go @@ -1,4 +1,4 @@ -package table_test +package tablestorage_test import ( "context" diff --git a/server/azure/network/handler.go b/server/azure/vnet/handler.go similarity index 99% rename from server/azure/network/handler.go rename to server/azure/vnet/handler.go index 6e2692e0..ee3087a1 100644 --- a/server/azure/network/handler.go +++ b/server/azure/vnet/handler.go @@ -1,4 +1,4 @@ -// Package network implements the Microsoft.Network ARM resources we expose: +// Package vnet implements the Microsoft.Network ARM resources we expose: // virtualNetworks, subnets (nested), and networkSecurityGroups. Real // armnetwork clients hit this handler the same way they hit // management.azure.com. @@ -12,7 +12,7 @@ // GET .../virtualNetworks/{vn}/subnets — list subnets // PUT/GET/DELETE .../networkSecurityGroups/{name} — NSG CRUD // GET .../networkSecurityGroups — list NSGs -package network +package vnet import ( "context" diff --git a/server/azure/network/network_test.go b/server/azure/vnet/network_test.go similarity index 99% rename from server/azure/network/network_test.go rename to server/azure/vnet/network_test.go index bad46368..d3cccc4e 100644 --- a/server/azure/network/network_test.go +++ b/server/azure/vnet/network_test.go @@ -1,4 +1,4 @@ -package network_test +package vnet_test import ( "context" diff --git a/server/azure/network/types.go b/server/azure/vnet/types.go similarity index 99% rename from server/azure/network/types.go rename to server/azure/vnet/types.go index 2b79833d..863657cd 100644 --- a/server/azure/network/types.go +++ b/server/azure/vnet/types.go @@ -1,4 +1,4 @@ -package network +package vnet // ARM JSON shapes for Microsoft.Network resources we expose. diff --git a/server/gcp/monitoring/handler.go b/server/gcp/cloudmonitoring/handler.go similarity index 98% rename from server/gcp/monitoring/handler.go rename to server/gcp/cloudmonitoring/handler.go index 22eeba98..2b3e3dd0 100644 --- a/server/gcp/monitoring/handler.go +++ b/server/gcp/cloudmonitoring/handler.go @@ -1,4 +1,4 @@ -// Package monitoring implements the GCP Cloud Monitoring REST API surface +// Package cloudmonitoring implements the GCP Cloud Monitoring REST API surface // for alert policies. cloud.google.com/go/monitoring uses gRPC by default; // this handler covers the REST equivalent for HTTP-level testing. // @@ -8,7 +8,7 @@ // GET /v3/projects/{p}/alertPolicies/{name} — get // GET /v3/projects/{p}/alertPolicies — list // DELETE /v3/projects/{p}/alertPolicies/{name} — delete -package monitoring +package cloudmonitoring import ( "encoding/json" diff --git a/server/gcp/monitoring/monitoring_test.go b/server/gcp/cloudmonitoring/monitoring_test.go similarity index 99% rename from server/gcp/monitoring/monitoring_test.go rename to server/gcp/cloudmonitoring/monitoring_test.go index 0b1a660f..91d9be31 100644 --- a/server/gcp/monitoring/monitoring_test.go +++ b/server/gcp/cloudmonitoring/monitoring_test.go @@ -1,4 +1,4 @@ -package monitoring_test +package cloudmonitoring_test import ( "bytes" diff --git a/server/gcp/monitoring/types.go b/server/gcp/cloudmonitoring/types.go similarity index 98% rename from server/gcp/monitoring/types.go rename to server/gcp/cloudmonitoring/types.go index efb1bea6..3c0fa6f2 100644 --- a/server/gcp/monitoring/types.go +++ b/server/gcp/cloudmonitoring/types.go @@ -1,4 +1,4 @@ -package monitoring +package cloudmonitoring // GCP Cloud Monitoring REST shapes. diff --git a/server/gcp/compute/compute_test.go b/server/gcp/gce/compute_test.go similarity index 99% rename from server/gcp/compute/compute_test.go rename to server/gcp/gce/compute_test.go index 9340e220..c45bcf74 100644 --- a/server/gcp/compute/compute_test.go +++ b/server/gcp/gce/compute_test.go @@ -1,4 +1,4 @@ -package compute_test +package gce_test import ( "bytes" diff --git a/server/gcp/compute/disks.go b/server/gcp/gce/disks.go similarity index 99% rename from server/gcp/compute/disks.go rename to server/gcp/gce/disks.go index 30fedb80..18e7557e 100644 --- a/server/gcp/compute/disks.go +++ b/server/gcp/gce/disks.go @@ -1,4 +1,4 @@ -package compute +package gce import ( "context" diff --git a/server/gcp/compute/disks_sdk_test.go b/server/gcp/gce/disks_sdk_test.go similarity index 99% rename from server/gcp/compute/disks_sdk_test.go rename to server/gcp/gce/disks_sdk_test.go index 3ca97e3c..40a10011 100644 --- a/server/gcp/compute/disks_sdk_test.go +++ b/server/gcp/gce/disks_sdk_test.go @@ -1,4 +1,4 @@ -package compute_test +package gce_test import ( "context" diff --git a/server/gcp/compute/handler.go b/server/gcp/gce/handler.go similarity index 98% rename from server/gcp/compute/handler.go rename to server/gcp/gce/handler.go index 830eabfc..546ff498 100644 --- a/server/gcp/compute/handler.go +++ b/server/gcp/gce/handler.go @@ -1,4 +1,4 @@ -// Package compute serves GCP Compute Engine REST API requests against a +// Package gce serves GCP Compute Engine REST API requests against a // CloudEmu compute driver. Real cloud.google.com/go/compute clients // configured with a custom endpoint hit this handler the same way they hit // compute.googleapis.com. @@ -16,7 +16,7 @@ // // Less-used surfaces (aggregated list, snapshots, disks, images) are not yet // wired and return 501 Not Implemented. -package compute +package gce import ( "net/http" diff --git a/server/gcp/compute/images.go b/server/gcp/gce/images.go similarity index 99% rename from server/gcp/compute/images.go rename to server/gcp/gce/images.go index b0eecd6b..78e5aa40 100644 --- a/server/gcp/compute/images.go +++ b/server/gcp/gce/images.go @@ -1,4 +1,4 @@ -package compute +package gce import ( "context" diff --git a/server/gcp/compute/images_sdk_test.go b/server/gcp/gce/images_sdk_test.go similarity index 99% rename from server/gcp/compute/images_sdk_test.go rename to server/gcp/gce/images_sdk_test.go index add10b3b..17df9049 100644 --- a/server/gcp/compute/images_sdk_test.go +++ b/server/gcp/gce/images_sdk_test.go @@ -1,4 +1,4 @@ -package compute_test +package gce_test import ( "context" diff --git a/server/gcp/compute/instances.go b/server/gcp/gce/instances.go similarity index 99% rename from server/gcp/compute/instances.go rename to server/gcp/gce/instances.go index 4e7d5ae9..d397871f 100644 --- a/server/gcp/compute/instances.go +++ b/server/gcp/gce/instances.go @@ -1,4 +1,4 @@ -package compute +package gce import ( "context" diff --git a/server/gcp/compute/sdk_roundtrip_test.go b/server/gcp/gce/sdk_roundtrip_test.go similarity index 99% rename from server/gcp/compute/sdk_roundtrip_test.go rename to server/gcp/gce/sdk_roundtrip_test.go index d7be3679..942aa4b9 100644 --- a/server/gcp/compute/sdk_roundtrip_test.go +++ b/server/gcp/gce/sdk_roundtrip_test.go @@ -1,4 +1,4 @@ -package compute_test +package gce_test import ( "context" diff --git a/server/gcp/compute/snapshots.go b/server/gcp/gce/snapshots.go similarity index 99% rename from server/gcp/compute/snapshots.go rename to server/gcp/gce/snapshots.go index 769d722f..51a00f7f 100644 --- a/server/gcp/compute/snapshots.go +++ b/server/gcp/gce/snapshots.go @@ -1,4 +1,4 @@ -package compute +package gce import ( "context" diff --git a/server/gcp/compute/snapshots_sdk_test.go b/server/gcp/gce/snapshots_sdk_test.go similarity index 99% rename from server/gcp/compute/snapshots_sdk_test.go rename to server/gcp/gce/snapshots_sdk_test.go index bcf3a948..9ebb261b 100644 --- a/server/gcp/compute/snapshots_sdk_test.go +++ b/server/gcp/gce/snapshots_sdk_test.go @@ -1,4 +1,4 @@ -package compute_test +package gce_test import ( "context" diff --git a/server/gcp/compute/types.go b/server/gcp/gce/types.go similarity index 99% rename from server/gcp/compute/types.go rename to server/gcp/gce/types.go index ee06de71..1a73292b 100644 --- a/server/gcp/compute/types.go +++ b/server/gcp/gce/types.go @@ -1,4 +1,4 @@ -package compute +package gce // GCP REST JSON shapes for compute#instance. // diff --git a/server/gcp/gcp.go b/server/gcp/gcp.go index 1a33d116..9dcacc4e 100644 --- a/server/gcp/gcp.go +++ b/server/gcp/gcp.go @@ -16,23 +16,23 @@ import ( "github.com/stackshy/cloudemu/v2/server/gcp/clouddns" "github.com/stackshy/cloudemu/v2/server/gcp/cloudfunctions" cloudloggingsrv "github.com/stackshy/cloudemu/v2/server/gcp/cloudlogging" + "github.com/stackshy/cloudemu/v2/server/gcp/cloudmonitoring" "github.com/stackshy/cloudemu/v2/server/gcp/cloudsql" - "github.com/stackshy/cloudemu/v2/server/gcp/compute" "github.com/stackshy/cloudemu/v2/server/gcp/eventarc" fcmsrv "github.com/stackshy/cloudemu/v2/server/gcp/fcm" "github.com/stackshy/cloudemu/v2/server/gcp/firestore" + "github.com/stackshy/cloudemu/v2/server/gcp/gce" "github.com/stackshy/cloudemu/v2/server/gcp/gcs" "github.com/stackshy/cloudemu/v2/server/gcp/gke" "github.com/stackshy/cloudemu/v2/server/gcp/iam" lbsrv "github.com/stackshy/cloudemu/v2/server/gcp/loadbalancer" "github.com/stackshy/cloudemu/v2/server/gcp/lro" memorystoresrv "github.com/stackshy/cloudemu/v2/server/gcp/memorystore" - "github.com/stackshy/cloudemu/v2/server/gcp/monitoring" - "github.com/stackshy/cloudemu/v2/server/gcp/networks" "github.com/stackshy/cloudemu/v2/server/gcp/pubsub" secretmanagersrv "github.com/stackshy/cloudemu/v2/server/gcp/secretmanager" "github.com/stackshy/cloudemu/v2/server/gcp/servicenetworking" vertexaisrv "github.com/stackshy/cloudemu/v2/server/gcp/vertexai" + "github.com/stackshy/cloudemu/v2/server/gcp/vpc" btdriver "github.com/stackshy/cloudemu/v2/services/bigtable/driver" cachedriver "github.com/stackshy/cloudemu/v2/services/cache/driver" computedriver "github.com/stackshy/cloudemu/v2/services/compute/driver" @@ -142,11 +142,11 @@ func New(d Drivers) *server.Server { srv.Register(lro.New()) if d.Compute != nil { - srv.Register(compute.New(d.Compute)) + srv.Register(gce.New(d.Compute)) } if d.Networking != nil { - srv.Register(networks.New(d.Networking)) + srv.Register(vpc.New(d.Networking)) } // Service Networking has no driver: a private-services connection is a @@ -289,7 +289,7 @@ func New(d Drivers) *server.Server { } if d.Monitoring != nil { - srv.Register(monitoring.New(d.Monitoring)) + srv.Register(cloudmonitoring.New(d.Monitoring)) } // Kubernetes data-plane API. Matches /k8s/{uid}/... — disjoint from every diff --git a/server/gcp/networks/addresses.go b/server/gcp/vpc/addresses.go similarity index 99% rename from server/gcp/networks/addresses.go rename to server/gcp/vpc/addresses.go index d15cb310..5da694a3 100644 --- a/server/gcp/networks/addresses.go +++ b/server/gcp/vpc/addresses.go @@ -1,4 +1,4 @@ -package networks +package vpc import ( "encoding/json" diff --git a/server/gcp/networks/handler.go b/server/gcp/vpc/handler.go similarity index 99% rename from server/gcp/networks/handler.go rename to server/gcp/vpc/handler.go index 1b4193b5..ea4ef972 100644 --- a/server/gcp/networks/handler.go +++ b/server/gcp/vpc/handler.go @@ -1,4 +1,4 @@ -// Package networks implements the GCP Compute Engine networking REST API +// Package vpc implements the GCP Compute Engine networking REST API // (networks, subnetworks, firewalls) against a CloudEmu networking driver. // Real cloud.google.com/go/compute clients hit this handler the same way // they hit compute.googleapis.com. @@ -19,7 +19,7 @@ // GET /compute/v1/projects/{p}/global/firewalls/{name} — get // GET /compute/v1/projects/{p}/global/firewalls — list // DELETE /compute/v1/projects/{p}/global/firewalls/{name} — delete -package networks +package vpc import ( "context" diff --git a/server/gcp/networks/networks_test.go b/server/gcp/vpc/networks_test.go similarity index 99% rename from server/gcp/networks/networks_test.go rename to server/gcp/vpc/networks_test.go index 0172c2d5..9215e0dd 100644 --- a/server/gcp/networks/networks_test.go +++ b/server/gcp/vpc/networks_test.go @@ -1,4 +1,4 @@ -package networks_test +package vpc_test import ( "context" diff --git a/server/gcp/networks/routers.go b/server/gcp/vpc/routers.go similarity index 99% rename from server/gcp/networks/routers.go rename to server/gcp/vpc/routers.go index 81ae86e5..5db8fda0 100644 --- a/server/gcp/networks/routers.go +++ b/server/gcp/vpc/routers.go @@ -1,4 +1,4 @@ -package networks +package vpc import ( "encoding/json" diff --git a/server/gcp/networks/types.go b/server/gcp/vpc/types.go similarity index 99% rename from server/gcp/networks/types.go rename to server/gcp/vpc/types.go index 6be37378..5314615c 100644 --- a/server/gcp/networks/types.go +++ b/server/gcp/vpc/types.go @@ -1,4 +1,4 @@ -package networks +package vpc // GCP Compute Engine networking REST shapes. From b74af98a32b16c11c5bd720d596303af1f278b3e Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 10:52:12 +0530 Subject: [PATCH 09/15] refactor: use real SDK names elbv2/compute/monitoring on both layers (#325) Corrects the provider<->wire match direction for three services: the wire layer already carried the accurate SDK name. AWS elb->elbv2 (the mock is ALB/NLB v2); GCP gce->compute (compute.googleapis.com); GCP cloudmonitoring->monitoring (monitoring.googleapis.com). Provider and wire now both use the real name. --- providers/aws/aws.go | 6 +++--- providers/aws/{elb => elbv2}/attributes_race_test.go | 2 +- providers/aws/{elb => elbv2}/elb.go | 4 ++-- providers/aws/{elb => elbv2}/elb_test.go | 2 +- providers/aws/{elb => elbv2}/tags.go | 2 +- providers/gcp/alloydb/alloydb_test.go | 4 ++-- .../gcp/artifactregistry/artifactregistry_test.go | 6 +++--- providers/gcp/cloudsql/cloudsql_test.go | 4 ++-- providers/gcp/{gce => compute}/asg.go | 2 +- providers/gcp/{gce => compute}/gce.go | 4 ++-- providers/gcp/{gce => compute}/gce_test.go | 2 +- providers/gcp/{gce => compute}/spot.go | 2 +- providers/gcp/{gce => compute}/template.go | 2 +- providers/gcp/eventarc/eventarc_test.go | 6 +++--- providers/gcp/gcp.go | 12 ++++++------ .../{cloudmonitoring => monitoring}/monitoring.go | 4 ++-- .../monitoring_test.go | 2 +- server/aws/aws.go | 4 ++-- server/aws/{elb => elbv2}/attributes.go | 2 +- .../{elb => elbv2}/attributes_sdk_roundtrip_test.go | 2 +- server/aws/{elb => elbv2}/handler.go | 4 ++-- server/aws/{elb => elbv2}/operations.go | 2 +- server/aws/{elb => elbv2}/sdk_roundtrip_test.go | 2 +- server/aws/{elb => elbv2}/tags.go | 2 +- server/aws/{elb => elbv2}/types.go | 2 +- server/gcp/{gce => compute}/compute_test.go | 2 +- server/gcp/{gce => compute}/disks.go | 2 +- server/gcp/{gce => compute}/disks_sdk_test.go | 2 +- server/gcp/{gce => compute}/handler.go | 4 ++-- server/gcp/{gce => compute}/images.go | 2 +- server/gcp/{gce => compute}/images_sdk_test.go | 2 +- server/gcp/{gce => compute}/instances.go | 2 +- server/gcp/{gce => compute}/sdk_roundtrip_test.go | 2 +- server/gcp/{gce => compute}/snapshots.go | 2 +- server/gcp/{gce => compute}/snapshots_sdk_test.go | 2 +- server/gcp/{gce => compute}/types.go | 2 +- server/gcp/gcp.go | 8 ++++---- .../gcp/{cloudmonitoring => monitoring}/handler.go | 4 ++-- .../monitoring_test.go | 2 +- server/gcp/{cloudmonitoring => monitoring}/types.go | 2 +- 40 files changed, 63 insertions(+), 63 deletions(-) rename providers/aws/{elb => elbv2}/attributes_race_test.go (99%) rename providers/aws/{elb => elbv2}/elb.go (99%) rename providers/aws/{elb => elbv2}/elb_test.go (99%) rename providers/aws/{elb => elbv2}/tags.go (98%) rename providers/gcp/{gce => compute}/asg.go (99%) rename providers/gcp/{gce => compute}/gce.go (99%) rename providers/gcp/{gce => compute}/gce_test.go (99%) rename providers/gcp/{gce => compute}/spot.go (99%) rename providers/gcp/{gce => compute}/template.go (99%) rename providers/gcp/{cloudmonitoring => monitoring}/monitoring.go (99%) rename providers/gcp/{cloudmonitoring => monitoring}/monitoring_test.go (99%) rename server/aws/{elb => elbv2}/attributes.go (99%) rename server/aws/{elb => elbv2}/attributes_sdk_roundtrip_test.go (99%) rename server/aws/{elb => elbv2}/handler.go (98%) rename server/aws/{elb => elbv2}/operations.go (99%) rename server/aws/{elb => elbv2}/sdk_roundtrip_test.go (99%) rename server/aws/{elb => elbv2}/tags.go (99%) rename server/aws/{elb => elbv2}/types.go (99%) rename server/gcp/{gce => compute}/compute_test.go (99%) rename server/gcp/{gce => compute}/disks.go (99%) rename server/gcp/{gce => compute}/disks_sdk_test.go (99%) rename server/gcp/{gce => compute}/handler.go (98%) rename server/gcp/{gce => compute}/images.go (99%) rename server/gcp/{gce => compute}/images_sdk_test.go (99%) rename server/gcp/{gce => compute}/instances.go (99%) rename server/gcp/{gce => compute}/sdk_roundtrip_test.go (99%) rename server/gcp/{gce => compute}/snapshots.go (99%) rename server/gcp/{gce => compute}/snapshots_sdk_test.go (99%) rename server/gcp/{gce => compute}/types.go (99%) rename server/gcp/{cloudmonitoring => monitoring}/handler.go (98%) rename server/gcp/{cloudmonitoring => monitoring}/monitoring_test.go (99%) rename server/gcp/{cloudmonitoring => monitoring}/types.go (98%) diff --git a/providers/aws/aws.go b/providers/aws/aws.go index 1bce5a4a..ddc068b1 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -19,7 +19,7 @@ import ( "github.com/stackshy/cloudemu/v2/providers/aws/eks" eksdriver "github.com/stackshy/cloudemu/v2/providers/aws/eks/driver" "github.com/stackshy/cloudemu/v2/providers/aws/elasticache" - "github.com/stackshy/cloudemu/v2/providers/aws/elb" + "github.com/stackshy/cloudemu/v2/providers/aws/elbv2" "github.com/stackshy/cloudemu/v2/providers/aws/eventbridge" "github.com/stackshy/cloudemu/v2/providers/aws/iam" "github.com/stackshy/cloudemu/v2/providers/aws/keyspaces" @@ -124,7 +124,7 @@ type Provider struct { CloudWatch *cloudwatch.Mock IAM *iam.Mock Route53 *route53.Mock - ELB *elb.Mock + ELB *elbv2.Mock SQS *sqs.Mock ElastiCache *elasticache.Mock Keyspaces *keyspaces.Mock @@ -161,7 +161,7 @@ func New(opts ...config.Option) *Provider { CloudWatch: cloudwatch.New(o), IAM: iam.New(o), Route53: route53.New(o), - ELB: elb.New(o), + ELB: elbv2.New(o), SQS: sqs.New(o), ElastiCache: elasticache.New(o), Keyspaces: keyspaces.New(o), diff --git a/providers/aws/elb/attributes_race_test.go b/providers/aws/elbv2/attributes_race_test.go similarity index 99% rename from providers/aws/elb/attributes_race_test.go rename to providers/aws/elbv2/attributes_race_test.go index 8962b10e..17b13160 100644 --- a/providers/aws/elb/attributes_race_test.go +++ b/providers/aws/elbv2/attributes_race_test.go @@ -1,4 +1,4 @@ -package elb +package elbv2 import ( "context" diff --git a/providers/aws/elb/elb.go b/providers/aws/elbv2/elb.go similarity index 99% rename from providers/aws/elb/elb.go rename to providers/aws/elbv2/elb.go index a531dec7..82638940 100644 --- a/providers/aws/elb/elb.go +++ b/providers/aws/elbv2/elb.go @@ -1,5 +1,5 @@ -// Package elb provides an in-memory mock implementation of AWS Elastic Load Balancing. -package elb +// Package elbv2 provides an in-memory mock implementation of AWS Elastic Load Balancing. +package elbv2 import ( "context" diff --git a/providers/aws/elb/elb_test.go b/providers/aws/elbv2/elb_test.go similarity index 99% rename from providers/aws/elb/elb_test.go rename to providers/aws/elbv2/elb_test.go index 8811a6d0..5e77d6ff 100644 --- a/providers/aws/elb/elb_test.go +++ b/providers/aws/elbv2/elb_test.go @@ -1,4 +1,4 @@ -package elb +package elbv2 import ( "context" diff --git a/providers/aws/elb/tags.go b/providers/aws/elbv2/tags.go similarity index 98% rename from providers/aws/elb/tags.go rename to providers/aws/elbv2/tags.go index 1e9f38ed..79e49d11 100644 --- a/providers/aws/elb/tags.go +++ b/providers/aws/elbv2/tags.go @@ -1,4 +1,4 @@ -package elb +package elbv2 import "context" diff --git a/providers/gcp/alloydb/alloydb_test.go b/providers/gcp/alloydb/alloydb_test.go index 0c084b3b..1e971b99 100644 --- a/providers/gcp/alloydb/alloydb_test.go +++ b/providers/gcp/alloydb/alloydb_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/stackshy/cloudemu/v2/config" - "github.com/stackshy/cloudemu/v2/providers/gcp/cloudmonitoring" + "github.com/stackshy/cloudemu/v2/providers/gcp/monitoring" rdsdriver "github.com/stackshy/cloudemu/v2/services/relationaldb/driver" ) @@ -252,7 +252,7 @@ func TestInstanceMetricsEmitted(t *testing.T) { opts := config.NewOptions(config.WithClock(fc), config.WithRegion("us-central1"), config.WithProjectID("p")) m := New(opts) - mon := cloudmonitoring.New(opts) + mon := monitoring.New(opts) m.SetMonitoring(mon) ctx := context.Background() diff --git a/providers/gcp/artifactregistry/artifactregistry_test.go b/providers/gcp/artifactregistry/artifactregistry_test.go index 9d92359b..f6b8596f 100644 --- a/providers/gcp/artifactregistry/artifactregistry_test.go +++ b/providers/gcp/artifactregistry/artifactregistry_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/stackshy/cloudemu/v2/config" - "github.com/stackshy/cloudemu/v2/providers/gcp/cloudmonitoring" + "github.com/stackshy/cloudemu/v2/providers/gcp/monitoring" "github.com/stackshy/cloudemu/v2/services/containerregistry/driver" mondriver "github.com/stackshy/cloudemu/v2/services/monitoring/driver" "github.com/stretchr/testify/assert" @@ -21,11 +21,11 @@ func newTestMock() (*Mock, *config.FakeClock) { return New(opts), fc } -func newTestMockWithMonitoring() (*Mock, *cloudmonitoring.Mock, *config.FakeClock) { +func newTestMockWithMonitoring() (*Mock, *monitoring.Mock, *config.FakeClock) { fc := config.NewFakeClock(time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC)) opts := config.NewOptions(config.WithClock(fc), config.WithRegion("us-central1"), config.WithProjectID("test-project")) - mon := cloudmonitoring.New(opts) + mon := monitoring.New(opts) m := New(opts) m.SetMonitoring(mon) diff --git a/providers/gcp/cloudsql/cloudsql_test.go b/providers/gcp/cloudsql/cloudsql_test.go index bb1674c1..c789455e 100644 --- a/providers/gcp/cloudsql/cloudsql_test.go +++ b/providers/gcp/cloudsql/cloudsql_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/stackshy/cloudemu/v2/config" - "github.com/stackshy/cloudemu/v2/providers/gcp/cloudmonitoring" + "github.com/stackshy/cloudemu/v2/providers/gcp/monitoring" rdsdriver "github.com/stackshy/cloudemu/v2/services/relationaldb/driver" ) @@ -502,7 +502,7 @@ func TestClusterOpsAndMonitoringCoverage(t *testing.T) { opts := config.NewOptions(config.WithClock(fc), config.WithRegion("us-central1"), config.WithProjectID("p")) m := New(opts) - mon := cloudmonitoring.New(opts) + mon := monitoring.New(opts) m.SetMonitoring(mon) ctx := context.Background() diff --git a/providers/gcp/gce/asg.go b/providers/gcp/compute/asg.go similarity index 99% rename from providers/gcp/gce/asg.go rename to providers/gcp/compute/asg.go index 45592ef5..04e68351 100644 --- a/providers/gcp/gce/asg.go +++ b/providers/gcp/compute/asg.go @@ -1,4 +1,4 @@ -package gce +package compute import ( "context" diff --git a/providers/gcp/gce/gce.go b/providers/gcp/compute/gce.go similarity index 99% rename from providers/gcp/gce/gce.go rename to providers/gcp/compute/gce.go index 49630861..d54c8ad3 100644 --- a/providers/gcp/gce/gce.go +++ b/providers/gcp/compute/gce.go @@ -1,5 +1,5 @@ -// Package gce provides an in-memory mock implementation of Google Compute Engine. -package gce +// Package compute provides an in-memory mock implementation of Google Compute Engine. +package compute import ( "context" diff --git a/providers/gcp/gce/gce_test.go b/providers/gcp/compute/gce_test.go similarity index 99% rename from providers/gcp/gce/gce_test.go rename to providers/gcp/compute/gce_test.go index e57f8227..2f49c9e6 100644 --- a/providers/gcp/gce/gce_test.go +++ b/providers/gcp/compute/gce_test.go @@ -1,4 +1,4 @@ -package gce +package compute import ( "context" diff --git a/providers/gcp/gce/spot.go b/providers/gcp/compute/spot.go similarity index 99% rename from providers/gcp/gce/spot.go rename to providers/gcp/compute/spot.go index 372d73cd..46447038 100644 --- a/providers/gcp/gce/spot.go +++ b/providers/gcp/compute/spot.go @@ -1,4 +1,4 @@ -package gce +package compute import ( "context" diff --git a/providers/gcp/gce/template.go b/providers/gcp/compute/template.go similarity index 99% rename from providers/gcp/gce/template.go rename to providers/gcp/compute/template.go index ad23b1dd..d1b03ba9 100644 --- a/providers/gcp/gce/template.go +++ b/providers/gcp/compute/template.go @@ -1,4 +1,4 @@ -package gce +package compute import ( "context" diff --git a/providers/gcp/eventarc/eventarc_test.go b/providers/gcp/eventarc/eventarc_test.go index 4a0b6759..de1a0687 100644 --- a/providers/gcp/eventarc/eventarc_test.go +++ b/providers/gcp/eventarc/eventarc_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/stackshy/cloudemu/v2/config" - "github.com/stackshy/cloudemu/v2/providers/gcp/cloudmonitoring" + "github.com/stackshy/cloudemu/v2/providers/gcp/monitoring" "github.com/stackshy/cloudemu/v2/services/eventbus/driver" mondriver "github.com/stackshy/cloudemu/v2/services/monitoring/driver" "github.com/stackshy/cloudemu/v2/services/scope" @@ -21,11 +21,11 @@ func newTestMock() (*Mock, *config.FakeClock) { return New(opts), fc } -func newTestMockWithMonitoring() (*Mock, *cloudmonitoring.Mock, *config.FakeClock) { +func newTestMockWithMonitoring() (*Mock, *monitoring.Mock, *config.FakeClock) { fc := config.NewFakeClock(time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC)) opts := config.NewOptions(config.WithClock(fc), config.WithRegion("us-central1"), config.WithProjectID("test-project")) - mon := cloudmonitoring.New(opts) + mon := monitoring.New(opts) m := New(opts) m.SetMonitoring(mon) diff --git a/providers/gcp/gcp.go b/providers/gcp/gcp.go index f899820f..35a21bc3 100644 --- a/providers/gcp/gcp.go +++ b/providers/gcp/gcp.go @@ -11,17 +11,17 @@ import ( "github.com/stackshy/cloudemu/v2/providers/gcp/clouddns" "github.com/stackshy/cloudemu/v2/providers/gcp/cloudfunctions" "github.com/stackshy/cloudemu/v2/providers/gcp/cloudlogging" - "github.com/stackshy/cloudemu/v2/providers/gcp/cloudmonitoring" "github.com/stackshy/cloudemu/v2/providers/gcp/cloudsql" + "github.com/stackshy/cloudemu/v2/providers/gcp/compute" "github.com/stackshy/cloudemu/v2/providers/gcp/eventarc" "github.com/stackshy/cloudemu/v2/providers/gcp/fcm" "github.com/stackshy/cloudemu/v2/providers/gcp/firestore" - "github.com/stackshy/cloudemu/v2/providers/gcp/gce" "github.com/stackshy/cloudemu/v2/providers/gcp/gcs" "github.com/stackshy/cloudemu/v2/providers/gcp/gke" "github.com/stackshy/cloudemu/v2/providers/gcp/iam" "github.com/stackshy/cloudemu/v2/providers/gcp/loadbalancer" "github.com/stackshy/cloudemu/v2/providers/gcp/memorystore" + "github.com/stackshy/cloudemu/v2/providers/gcp/monitoring" "github.com/stackshy/cloudemu/v2/providers/gcp/pubsub" "github.com/stackshy/cloudemu/v2/providers/gcp/secretmanager" "github.com/stackshy/cloudemu/v2/providers/gcp/vertexai" @@ -58,11 +58,11 @@ func (a gkeDiscovery) DiscoverClusters(ctx context.Context) ([]resourcediscovery // Provider holds all GCP mock services. type Provider struct { GCS *gcs.Mock - GCE *gce.Mock + GCE *compute.Mock Firestore *firestore.Mock CloudFunctions *cloudfunctions.Mock VPC *vpc.Mock - CloudMonitoring *cloudmonitoring.Mock + CloudMonitoring *monitoring.Mock IAM *iam.Mock CloudDNS *clouddns.Mock LB *loadbalancer.Mock @@ -93,11 +93,11 @@ func New(opts ...config.Option) *Provider { o := config.NewOptions(opts...) p := &Provider{ GCS: gcs.New(o), - GCE: gce.New(o), + GCE: compute.New(o), Firestore: firestore.New(o), CloudFunctions: cloudfunctions.New(o), VPC: vpc.New(o), - CloudMonitoring: cloudmonitoring.New(o), + CloudMonitoring: monitoring.New(o), IAM: iam.New(o), CloudDNS: clouddns.New(o), LB: loadbalancer.New(o), diff --git a/providers/gcp/cloudmonitoring/monitoring.go b/providers/gcp/monitoring/monitoring.go similarity index 99% rename from providers/gcp/cloudmonitoring/monitoring.go rename to providers/gcp/monitoring/monitoring.go index 8d12773b..1750a5dd 100644 --- a/providers/gcp/cloudmonitoring/monitoring.go +++ b/providers/gcp/monitoring/monitoring.go @@ -1,5 +1,5 @@ -// Package cloudmonitoring provides an in-memory mock implementation of GCP Cloud Monitoring. -package cloudmonitoring +// Package monitoring provides an in-memory mock implementation of GCP Cloud Monitoring. +package monitoring import ( "context" diff --git a/providers/gcp/cloudmonitoring/monitoring_test.go b/providers/gcp/monitoring/monitoring_test.go similarity index 99% rename from providers/gcp/cloudmonitoring/monitoring_test.go rename to providers/gcp/monitoring/monitoring_test.go index 433d688a..fd29ccef 100644 --- a/providers/gcp/cloudmonitoring/monitoring_test.go +++ b/providers/gcp/monitoring/monitoring_test.go @@ -1,4 +1,4 @@ -package cloudmonitoring +package monitoring import ( "context" diff --git a/server/aws/aws.go b/server/aws/aws.go index 6aaab29a..3b0e6f24 100644 --- a/server/aws/aws.go +++ b/server/aws/aws.go @@ -21,7 +21,7 @@ import ( ecssrv "github.com/stackshy/cloudemu/v2/server/aws/ecs" "github.com/stackshy/cloudemu/v2/server/aws/eks" "github.com/stackshy/cloudemu/v2/server/aws/elasticache" - "github.com/stackshy/cloudemu/v2/server/aws/elb" + "github.com/stackshy/cloudemu/v2/server/aws/elbv2" "github.com/stackshy/cloudemu/v2/server/aws/eventbridge" "github.com/stackshy/cloudemu/v2/server/aws/iam" keyspacessrv "github.com/stackshy/cloudemu/v2/server/aws/keyspaces" @@ -306,7 +306,7 @@ func New(d Drivers) *server.Server { // RDS, IAM, Redshift, and EC2. It must register before the EC2 catch-all so // the EC2 handler doesn't claim ELBv2 form bodies first. if d.ELB != nil { - srv.Register(elb.New(d.ELB)) + srv.Register(elbv2.New(d.ELB)) } // ElastiCache is another AWS query-protocol handler; register before the diff --git a/server/aws/elb/attributes.go b/server/aws/elbv2/attributes.go similarity index 99% rename from server/aws/elb/attributes.go rename to server/aws/elbv2/attributes.go index 2e132e1e..7e0833cc 100644 --- a/server/aws/elb/attributes.go +++ b/server/aws/elbv2/attributes.go @@ -1,4 +1,4 @@ -package elb +package elbv2 import ( "encoding/xml" diff --git a/server/aws/elb/attributes_sdk_roundtrip_test.go b/server/aws/elbv2/attributes_sdk_roundtrip_test.go similarity index 99% rename from server/aws/elb/attributes_sdk_roundtrip_test.go rename to server/aws/elbv2/attributes_sdk_roundtrip_test.go index 0aecbc38..aeaf4f7d 100644 --- a/server/aws/elb/attributes_sdk_roundtrip_test.go +++ b/server/aws/elbv2/attributes_sdk_roundtrip_test.go @@ -1,4 +1,4 @@ -package elb_test +package elbv2_test import ( "context" diff --git a/server/aws/elb/handler.go b/server/aws/elbv2/handler.go similarity index 98% rename from server/aws/elb/handler.go rename to server/aws/elbv2/handler.go index 057fc399..969011fe 100644 --- a/server/aws/elb/handler.go +++ b/server/aws/elbv2/handler.go @@ -1,4 +1,4 @@ -// Package elb implements the AWS Elastic Load Balancing v2 (ALB/NLB) +// Package elbv2 implements the AWS Elastic Load Balancing v2 (ALB/NLB) // query-protocol as a server.Handler. Point the real aws-sdk-go-v2 // elasticloadbalancingv2 client at a Server registered with this handler and // LoadBalancer / TargetGroup / Listener / Rule / target-health operations work @@ -11,7 +11,7 @@ // other query-protocol actions, so this handler MUST register before EC2. Its // action set is disjoint from RDS/IAM/Redshift, so ordering relative to those // is unconstrained. -package elb +package elbv2 import ( "net/http" diff --git a/server/aws/elb/operations.go b/server/aws/elbv2/operations.go similarity index 99% rename from server/aws/elb/operations.go rename to server/aws/elbv2/operations.go index 04c48492..de78f6fd 100644 --- a/server/aws/elb/operations.go +++ b/server/aws/elbv2/operations.go @@ -1,4 +1,4 @@ -package elb +package elbv2 import ( "net/http" diff --git a/server/aws/elb/sdk_roundtrip_test.go b/server/aws/elbv2/sdk_roundtrip_test.go similarity index 99% rename from server/aws/elb/sdk_roundtrip_test.go rename to server/aws/elbv2/sdk_roundtrip_test.go index f20f13a5..02e97fc8 100644 --- a/server/aws/elb/sdk_roundtrip_test.go +++ b/server/aws/elbv2/sdk_roundtrip_test.go @@ -1,4 +1,4 @@ -package elb_test +package elbv2_test import ( "context" diff --git a/server/aws/elb/tags.go b/server/aws/elbv2/tags.go similarity index 99% rename from server/aws/elb/tags.go rename to server/aws/elbv2/tags.go index c67e6b67..076ea88d 100644 --- a/server/aws/elb/tags.go +++ b/server/aws/elbv2/tags.go @@ -1,4 +1,4 @@ -package elb +package elbv2 import ( "context" diff --git a/server/aws/elb/types.go b/server/aws/elbv2/types.go similarity index 99% rename from server/aws/elb/types.go rename to server/aws/elbv2/types.go index 9891f5d1..2df9354e 100644 --- a/server/aws/elb/types.go +++ b/server/aws/elbv2/types.go @@ -1,4 +1,4 @@ -package elb +package elbv2 import ( "encoding/xml" diff --git a/server/gcp/gce/compute_test.go b/server/gcp/compute/compute_test.go similarity index 99% rename from server/gcp/gce/compute_test.go rename to server/gcp/compute/compute_test.go index c45bcf74..9340e220 100644 --- a/server/gcp/gce/compute_test.go +++ b/server/gcp/compute/compute_test.go @@ -1,4 +1,4 @@ -package gce_test +package compute_test import ( "bytes" diff --git a/server/gcp/gce/disks.go b/server/gcp/compute/disks.go similarity index 99% rename from server/gcp/gce/disks.go rename to server/gcp/compute/disks.go index 18e7557e..30fedb80 100644 --- a/server/gcp/gce/disks.go +++ b/server/gcp/compute/disks.go @@ -1,4 +1,4 @@ -package gce +package compute import ( "context" diff --git a/server/gcp/gce/disks_sdk_test.go b/server/gcp/compute/disks_sdk_test.go similarity index 99% rename from server/gcp/gce/disks_sdk_test.go rename to server/gcp/compute/disks_sdk_test.go index 40a10011..3ca97e3c 100644 --- a/server/gcp/gce/disks_sdk_test.go +++ b/server/gcp/compute/disks_sdk_test.go @@ -1,4 +1,4 @@ -package gce_test +package compute_test import ( "context" diff --git a/server/gcp/gce/handler.go b/server/gcp/compute/handler.go similarity index 98% rename from server/gcp/gce/handler.go rename to server/gcp/compute/handler.go index 546ff498..830eabfc 100644 --- a/server/gcp/gce/handler.go +++ b/server/gcp/compute/handler.go @@ -1,4 +1,4 @@ -// Package gce serves GCP Compute Engine REST API requests against a +// Package compute serves GCP Compute Engine REST API requests against a // CloudEmu compute driver. Real cloud.google.com/go/compute clients // configured with a custom endpoint hit this handler the same way they hit // compute.googleapis.com. @@ -16,7 +16,7 @@ // // Less-used surfaces (aggregated list, snapshots, disks, images) are not yet // wired and return 501 Not Implemented. -package gce +package compute import ( "net/http" diff --git a/server/gcp/gce/images.go b/server/gcp/compute/images.go similarity index 99% rename from server/gcp/gce/images.go rename to server/gcp/compute/images.go index 78e5aa40..b0eecd6b 100644 --- a/server/gcp/gce/images.go +++ b/server/gcp/compute/images.go @@ -1,4 +1,4 @@ -package gce +package compute import ( "context" diff --git a/server/gcp/gce/images_sdk_test.go b/server/gcp/compute/images_sdk_test.go similarity index 99% rename from server/gcp/gce/images_sdk_test.go rename to server/gcp/compute/images_sdk_test.go index 17df9049..add10b3b 100644 --- a/server/gcp/gce/images_sdk_test.go +++ b/server/gcp/compute/images_sdk_test.go @@ -1,4 +1,4 @@ -package gce_test +package compute_test import ( "context" diff --git a/server/gcp/gce/instances.go b/server/gcp/compute/instances.go similarity index 99% rename from server/gcp/gce/instances.go rename to server/gcp/compute/instances.go index d397871f..4e7d5ae9 100644 --- a/server/gcp/gce/instances.go +++ b/server/gcp/compute/instances.go @@ -1,4 +1,4 @@ -package gce +package compute import ( "context" diff --git a/server/gcp/gce/sdk_roundtrip_test.go b/server/gcp/compute/sdk_roundtrip_test.go similarity index 99% rename from server/gcp/gce/sdk_roundtrip_test.go rename to server/gcp/compute/sdk_roundtrip_test.go index 942aa4b9..d7be3679 100644 --- a/server/gcp/gce/sdk_roundtrip_test.go +++ b/server/gcp/compute/sdk_roundtrip_test.go @@ -1,4 +1,4 @@ -package gce_test +package compute_test import ( "context" diff --git a/server/gcp/gce/snapshots.go b/server/gcp/compute/snapshots.go similarity index 99% rename from server/gcp/gce/snapshots.go rename to server/gcp/compute/snapshots.go index 51a00f7f..769d722f 100644 --- a/server/gcp/gce/snapshots.go +++ b/server/gcp/compute/snapshots.go @@ -1,4 +1,4 @@ -package gce +package compute import ( "context" diff --git a/server/gcp/gce/snapshots_sdk_test.go b/server/gcp/compute/snapshots_sdk_test.go similarity index 99% rename from server/gcp/gce/snapshots_sdk_test.go rename to server/gcp/compute/snapshots_sdk_test.go index 9ebb261b..bcf3a948 100644 --- a/server/gcp/gce/snapshots_sdk_test.go +++ b/server/gcp/compute/snapshots_sdk_test.go @@ -1,4 +1,4 @@ -package gce_test +package compute_test import ( "context" diff --git a/server/gcp/gce/types.go b/server/gcp/compute/types.go similarity index 99% rename from server/gcp/gce/types.go rename to server/gcp/compute/types.go index 1a73292b..ee06de71 100644 --- a/server/gcp/gce/types.go +++ b/server/gcp/compute/types.go @@ -1,4 +1,4 @@ -package gce +package compute // GCP REST JSON shapes for compute#instance. // diff --git a/server/gcp/gcp.go b/server/gcp/gcp.go index 9dcacc4e..5014d746 100644 --- a/server/gcp/gcp.go +++ b/server/gcp/gcp.go @@ -16,18 +16,18 @@ import ( "github.com/stackshy/cloudemu/v2/server/gcp/clouddns" "github.com/stackshy/cloudemu/v2/server/gcp/cloudfunctions" cloudloggingsrv "github.com/stackshy/cloudemu/v2/server/gcp/cloudlogging" - "github.com/stackshy/cloudemu/v2/server/gcp/cloudmonitoring" "github.com/stackshy/cloudemu/v2/server/gcp/cloudsql" + "github.com/stackshy/cloudemu/v2/server/gcp/compute" "github.com/stackshy/cloudemu/v2/server/gcp/eventarc" fcmsrv "github.com/stackshy/cloudemu/v2/server/gcp/fcm" "github.com/stackshy/cloudemu/v2/server/gcp/firestore" - "github.com/stackshy/cloudemu/v2/server/gcp/gce" "github.com/stackshy/cloudemu/v2/server/gcp/gcs" "github.com/stackshy/cloudemu/v2/server/gcp/gke" "github.com/stackshy/cloudemu/v2/server/gcp/iam" lbsrv "github.com/stackshy/cloudemu/v2/server/gcp/loadbalancer" "github.com/stackshy/cloudemu/v2/server/gcp/lro" memorystoresrv "github.com/stackshy/cloudemu/v2/server/gcp/memorystore" + "github.com/stackshy/cloudemu/v2/server/gcp/monitoring" "github.com/stackshy/cloudemu/v2/server/gcp/pubsub" secretmanagersrv "github.com/stackshy/cloudemu/v2/server/gcp/secretmanager" "github.com/stackshy/cloudemu/v2/server/gcp/servicenetworking" @@ -142,7 +142,7 @@ func New(d Drivers) *server.Server { srv.Register(lro.New()) if d.Compute != nil { - srv.Register(gce.New(d.Compute)) + srv.Register(compute.New(d.Compute)) } if d.Networking != nil { @@ -289,7 +289,7 @@ func New(d Drivers) *server.Server { } if d.Monitoring != nil { - srv.Register(cloudmonitoring.New(d.Monitoring)) + srv.Register(monitoring.New(d.Monitoring)) } // Kubernetes data-plane API. Matches /k8s/{uid}/... — disjoint from every diff --git a/server/gcp/cloudmonitoring/handler.go b/server/gcp/monitoring/handler.go similarity index 98% rename from server/gcp/cloudmonitoring/handler.go rename to server/gcp/monitoring/handler.go index 2b3e3dd0..22eeba98 100644 --- a/server/gcp/cloudmonitoring/handler.go +++ b/server/gcp/monitoring/handler.go @@ -1,4 +1,4 @@ -// Package cloudmonitoring implements the GCP Cloud Monitoring REST API surface +// Package monitoring implements the GCP Cloud Monitoring REST API surface // for alert policies. cloud.google.com/go/monitoring uses gRPC by default; // this handler covers the REST equivalent for HTTP-level testing. // @@ -8,7 +8,7 @@ // GET /v3/projects/{p}/alertPolicies/{name} — get // GET /v3/projects/{p}/alertPolicies — list // DELETE /v3/projects/{p}/alertPolicies/{name} — delete -package cloudmonitoring +package monitoring import ( "encoding/json" diff --git a/server/gcp/cloudmonitoring/monitoring_test.go b/server/gcp/monitoring/monitoring_test.go similarity index 99% rename from server/gcp/cloudmonitoring/monitoring_test.go rename to server/gcp/monitoring/monitoring_test.go index 91d9be31..0b1a660f 100644 --- a/server/gcp/cloudmonitoring/monitoring_test.go +++ b/server/gcp/monitoring/monitoring_test.go @@ -1,4 +1,4 @@ -package cloudmonitoring_test +package monitoring_test import ( "bytes" diff --git a/server/gcp/cloudmonitoring/types.go b/server/gcp/monitoring/types.go similarity index 98% rename from server/gcp/cloudmonitoring/types.go rename to server/gcp/monitoring/types.go index 3c0fa6f2..efb1bea6 100644 --- a/server/gcp/cloudmonitoring/types.go +++ b/server/gcp/monitoring/types.go @@ -1,4 +1,4 @@ -package cloudmonitoring +package monitoring // GCP Cloud Monitoring REST shapes. From bd8f5cc7e2f636ce01303dbeaafce6c5855d92c6 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 10:55:29 +0530 Subject: [PATCH 10/15] refactor: snake_case services/ driver filenames to match providers & wire (#325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cognitive_services.go, machine_learning.go, feature_store.go, vector_search.go in services/*/driver — restores same-filename-across-layers for these features. --- .../driver/{cognitiveservices.go => cognitive_services.go} | 0 .../azureai/driver/{machinelearning.go => machine_learning.go} | 0 services/sagemaker/driver/{featurestore.go => feature_store.go} | 0 services/vertexai/driver/{featurestore.go => feature_store.go} | 0 services/vertexai/driver/{vectorsearch.go => vector_search.go} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename services/azureai/driver/{cognitiveservices.go => cognitive_services.go} (100%) rename services/azureai/driver/{machinelearning.go => machine_learning.go} (100%) rename services/sagemaker/driver/{featurestore.go => feature_store.go} (100%) rename services/vertexai/driver/{featurestore.go => feature_store.go} (100%) rename services/vertexai/driver/{vectorsearch.go => vector_search.go} (100%) diff --git a/services/azureai/driver/cognitiveservices.go b/services/azureai/driver/cognitive_services.go similarity index 100% rename from services/azureai/driver/cognitiveservices.go rename to services/azureai/driver/cognitive_services.go diff --git a/services/azureai/driver/machinelearning.go b/services/azureai/driver/machine_learning.go similarity index 100% rename from services/azureai/driver/machinelearning.go rename to services/azureai/driver/machine_learning.go diff --git a/services/sagemaker/driver/featurestore.go b/services/sagemaker/driver/feature_store.go similarity index 100% rename from services/sagemaker/driver/featurestore.go rename to services/sagemaker/driver/feature_store.go diff --git a/services/vertexai/driver/featurestore.go b/services/vertexai/driver/feature_store.go similarity index 100% rename from services/vertexai/driver/featurestore.go rename to services/vertexai/driver/feature_store.go diff --git a/services/vertexai/driver/vectorsearch.go b/services/vertexai/driver/vector_search.go similarity index 100% rename from services/vertexai/driver/vectorsearch.go rename to services/vertexai/driver/vector_search.go From 627aefaff0dbc4c21e0ad714ba1b947ed039e819 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 11:22:00 +0530 Subject: [PATCH 11/15] docs: subdir-promotion rule is for new services; existing coupled mocks stay flat (#325) --- docs/STRUCTURE.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/STRUCTURE.md b/docs/STRUCTURE.md index 044a5002..33f33dc6 100644 --- a/docs/STRUCTURE.md +++ b/docs/STRUCTURE.md @@ -150,6 +150,17 @@ sub-API earns its own same-named subdirectory across the layers it touches. Smal sub-surfaces stay as flat `.go` files. Either way the filename/dirname is the same in every layer, so a feature always has one home. +### This rule is for NEW services — existing coupled mocks stay flat +Subdirectory promotion applies to **new services designed that way from the start**, +where each sub-surface owns its state. It is **not** retrofitted onto existing large +single-`Mock` providers such as `providers/aws/vpc` and `providers/azure/databricks`, +which are an **accepted flat exception**. In Go a directory is a package, so promoting +a sub-surface there would mean splitting one `Mock` (vpc: 256 methods, 57 fields under a +single mutex) into sub-packages — forcing a shared internal helper package, cross-surface +callback injection, and a change to the single-lock concurrency model. That trades real +behavior risk for a navigation win the per-feature `snake_case` files (§3) already deliver. +For these services, keep one cohesive package with one `.go` per sub-surface. + --- ## 6. Adding to the codebase — where things go From e8ecffcc968eda9c257cc9904c9aa3000bd5ab1e Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 11:57:17 +0530 Subject: [PATCH 12/15] ci: inline the Structure check into the workflow, drop scripts/ (#325) Moves the naming check into .github/workflows/ci.yml (no scripts/ folder) and hardens it to recurse at any depth so a promoted sub-surface subdir can't reintroduce a cloud prefix. --- ...rning_more.go => machine_learning_more.go} | 0 scripts/check_structure.sh | 34 ------------------- 2 files changed, 34 deletions(-) rename providers/azure/ai/{machinelearning_more.go => machine_learning_more.go} (100%) delete mode 100755 scripts/check_structure.sh diff --git a/providers/azure/ai/machinelearning_more.go b/providers/azure/ai/machine_learning_more.go similarity index 100% rename from providers/azure/ai/machinelearning_more.go rename to providers/azure/ai/machine_learning_more.go diff --git a/scripts/check_structure.sh b/scripts/check_structure.sh deleted file mode 100755 index 22e30590..00000000 --- a/scripts/check_structure.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# -# Enforces the repository structure convention documented in docs/STRUCTURE.md. -# Currently checks the unambiguous, deterministic rule: no provider or wire -# directory carries a redundant cloud prefix (the parent aws/azure/gcp already -# encodes the cloud). Run from the repo root. -set -euo pipefail - -fail=0 - -for cloud in aws azure gcp; do - for layer in providers server; do - dir="$layer/$cloud" - [ -d "$dir" ] || continue - for path in "$dir"/*/; do - [ -d "$path" ] || continue - name="$(basename "$path")" - case "$name" in - "$cloud"?*) - echo "structure: '$dir/$name' has a redundant '$cloud' prefix — drop it (see docs/STRUCTURE.md §2.2)" - fail=1 - ;; - esac - done - done -done - -if [ "$fail" -ne 0 ]; then - echo "" - echo "Structure check failed. See docs/STRUCTURE.md for the naming convention." - exit 1 -fi - -echo "structure: no cloud-prefixed provider/wire directories — OK" From bfb84ef8ace052e23c8ab88de6cad8e71add9395 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 11:57:17 +0530 Subject: [PATCH 13/15] refactor(azure): drop Azure prefix on provider fields + machine_learning_more filename (#325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provider fields AzureAI/AzureSearch -> AI/Search (matching unprefixed siblings); machinelearning_more.go -> machine_learning_more.go (snake_case §3). --- features/chaos/wrappers_azureai_test.go | 2 +- providers/azure/azure.go | 12 ++++++------ server/azure/ai/dataplane_roundtrip_test.go | 4 ++-- server/azure/ai/machinelearning_roundtrip_test.go | 4 ++-- server/azure/ai/sdk_roundtrip_test.go | 4 ++-- server/azure/from_provider.go | 10 +++++----- server/azure/search/sdk_roundtrip_test.go | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/features/chaos/wrappers_azureai_test.go b/features/chaos/wrappers_azureai_test.go index 508f068c..c8588dbb 100644 --- a/features/chaos/wrappers_azureai_test.go +++ b/features/chaos/wrappers_azureai_test.go @@ -17,7 +17,7 @@ func newChaosAzureAI(t *testing.T) (driver.AzureAI, *chaos.Engine) { e := chaos.New(config.RealClock{}) t.Cleanup(e.Stop) - return chaos.WrapAzureAI(cloudemu.NewAzure().AzureAI, e), e + return chaos.WrapAzureAI(cloudemu.NewAzure().AI, e), e } func TestWrapAzureAICreateAccountChaos(t *testing.T) { diff --git a/providers/azure/azure.go b/providers/azure/azure.go index ee48a2ad..59dbcf70 100644 --- a/providers/azure/azure.go +++ b/providers/azure/azure.go @@ -144,8 +144,8 @@ type Provider struct { MySQLFlex *mysqlflex.Mock AKS *aks.Mock Databricks *databricks.Mock - AzureAI *ai.Mock - AzureSearch *search.Mock + AI *ai.Mock + Search *search.Mock ResourceDiscovery *resourcediscovery.Engine @@ -186,8 +186,8 @@ func New(opts ...config.Option) *Provider { MySQLFlex: mysqlflex.New(o), AKS: aks.New(o), Databricks: databricks.New(o), - AzureAI: ai.New(o), - AzureSearch: search.New(o), + AI: ai.New(o), + Search: search.New(o), SubscriptionID: o.AccountID, Region: o.Region, } @@ -205,8 +205,8 @@ func New(opts ...config.Option) *Provider { p.PostgresFlex.SetMonitoring(p.Monitor) p.MySQLFlex.SetMonitoring(p.Monitor) p.AKS.SetMonitoring(p.Monitor) - p.AzureAI.SetMonitoring(p.Monitor) - p.AzureSearch.SetMonitoring(p.Monitor) + p.AI.SetMonitoring(p.Monitor) + p.Search.SetMonitoring(p.Monitor) p.ResourceDiscovery = resourcediscovery.New( resourcediscovery.ProviderAzure, o.AccountID, o.Region, diff --git a/server/azure/ai/dataplane_roundtrip_test.go b/server/azure/ai/dataplane_roundtrip_test.go index 6c77a815..a6c46ce2 100644 --- a/server/azure/ai/dataplane_roundtrip_test.go +++ b/server/azure/ai/dataplane_roundtrip_test.go @@ -21,7 +21,7 @@ func newDPServer(t *testing.T) string { t.Helper() cloud := cloudemu.NewAzure() - srv := azureserver.New(azureserver.Drivers{AzureAIDataPlane: cloud.AzureAI}) + srv := azureserver.New(azureserver.Drivers{AzureAIDataPlane: cloud.AI}) ts := httptest.NewServer(srv) t.Cleanup(ts.Close) @@ -153,7 +153,7 @@ func newAOAIClient(t *testing.T) *azopenai.Client { t.Helper() cloudP := cloudemu.NewAzure() - srv := azureserver.New(azureserver.Drivers{AzureAIDataPlane: cloudP.AzureAI}) + srv := azureserver.New(azureserver.Drivers{AzureAIDataPlane: cloudP.AI}) ts := httptest.NewTLSServer(srv) t.Cleanup(ts.Close) diff --git a/server/azure/ai/machinelearning_roundtrip_test.go b/server/azure/ai/machinelearning_roundtrip_test.go index a4bb54db..55d84a5c 100644 --- a/server/azure/ai/machinelearning_roundtrip_test.go +++ b/server/azure/ai/machinelearning_roundtrip_test.go @@ -23,7 +23,7 @@ func newMLServer(t *testing.T) string { t.Helper() cloud := cloudemu.NewAzure() - srv := azureserver.New(azureserver.Drivers{MachineLearning: cloud.AzureAI}) + srv := azureserver.New(azureserver.Drivers{MachineLearning: cloud.AI}) ts := httptest.NewServer(srv) t.Cleanup(ts.Close) @@ -166,7 +166,7 @@ func newMLClientFactory(t *testing.T) *armmachinelearning.ClientFactory { t.Helper() cloudP := cloudemu.NewAzure() - srv := azureserver.New(azureserver.Drivers{MachineLearning: cloudP.AzureAI}) + srv := azureserver.New(azureserver.Drivers{MachineLearning: cloudP.AI}) ts := httptest.NewTLSServer(srv) t.Cleanup(ts.Close) diff --git a/server/azure/ai/sdk_roundtrip_test.go b/server/azure/ai/sdk_roundtrip_test.go index af8189fb..ee046c73 100644 --- a/server/azure/ai/sdk_roundtrip_test.go +++ b/server/azure/ai/sdk_roundtrip_test.go @@ -61,7 +61,7 @@ func newServer(t *testing.T) string { t.Helper() cloud := cloudemu.NewAzure() - srv := azureserver.New(azureserver.Drivers{CognitiveServices: cloud.AzureAI}) + srv := azureserver.New(azureserver.Drivers{CognitiveServices: cloud.AI}) ts := httptest.NewServer(srv) t.Cleanup(ts.Close) @@ -219,7 +219,7 @@ func newCSAccountsClient(t *testing.T) *armcognitiveservices.AccountsClient { t.Helper() cloudP := cloudemu.NewAzure() - srv := azureserver.New(azureserver.Drivers{CognitiveServices: cloudP.AzureAI}) + srv := azureserver.New(azureserver.Drivers{CognitiveServices: cloudP.AI}) ts := httptest.NewTLSServer(srv) t.Cleanup(ts.Close) diff --git a/server/azure/from_provider.go b/server/azure/from_provider.go index 64ba07d2..72502e18 100644 --- a/server/azure/from_provider.go +++ b/server/azure/from_provider.go @@ -56,14 +56,14 @@ func DriversFrom(p *azureprovider.Provider) Drivers { // Azure AI mock satisfies CognitiveServices, MachineLearning and the // inference/Assistants data plane. - CognitiveServices: p.AzureAI, - MachineLearning: p.AzureAI, - AzureAIDataPlane: p.AzureAI, + CognitiveServices: p.AI, + MachineLearning: p.AI, + AzureAIDataPlane: p.AI, // Azure AI Search mock satisfies both the ARM control plane and the // search data plane. - SearchControl: p.AzureSearch, - SearchDataPlane: p.AzureSearch, + SearchControl: p.Search, + SearchDataPlane: p.Search, // K8sAPI is a shared handle with no provider source; the standalone // server has no shared cluster by default. diff --git a/server/azure/search/sdk_roundtrip_test.go b/server/azure/search/sdk_roundtrip_test.go index f4518325..3f21b848 100644 --- a/server/azure/search/sdk_roundtrip_test.go +++ b/server/azure/search/sdk_roundtrip_test.go @@ -60,8 +60,8 @@ func newServer(t *testing.T) string { cloud := cloudemu.NewAzure() srv := azureserver.New(azureserver.Drivers{ - SearchControl: cloud.AzureSearch, - SearchDataPlane: cloud.AzureSearch, + SearchControl: cloud.Search, + SearchDataPlane: cloud.Search, }) ts := httptest.NewServer(srv) t.Cleanup(ts.Close) @@ -206,7 +206,7 @@ func newSearchClientFactory(t *testing.T) *armsearch.ClientFactory { t.Helper() cloudP := cloudemu.NewAzure() - srv := azureserver.New(azureserver.Drivers{SearchControl: cloudP.AzureSearch}) + srv := azureserver.New(azureserver.Drivers{SearchControl: cloudP.Search}) ts := httptest.NewTLSServer(srv) t.Cleanup(ts.Close) From a98020c882a22d6c3f356dc1af4884cc25e931c5 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 11:57:17 +0530 Subject: [PATCH 14/15] docs: sync architecture/services/sdk-server to new names; STRUCTURE precision (#325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update stale provider/wire dir names in the doc trees + coverage matrix; reword STRUCTURE §2.2 (short name, not 'SDK name'), label §5 example illustrative, and document the vpc<->ec2 and services/azureai product-name exceptions. --- docs/STRUCTURE.md | 32 ++++++++++++++++++++++++-------- docs/architecture.md | 28 ++++++++++++++-------------- docs/sdk-server.md | 2 +- docs/services.md | 42 +++++++++++++++++++++--------------------- 4 files changed, 60 insertions(+), 44 deletions(-) diff --git a/docs/STRUCTURE.md b/docs/STRUCTURE.md index 33f33dc6..2cc658d7 100644 --- a/docs/STRUCTURE.md +++ b/docs/STRUCTURE.md @@ -42,20 +42,23 @@ The shared abstraction is named for the **capability**, never a product: Product-specific services with no cross-cloud abstraction keep their **product name** consistently (`bedrock`, `vertexai`, `databricks`, `bigtable`, `ecs`, `sagemaker`, …). -### 2.2 `providers//` and `server//` — real SDK name, no cloud prefix -The mock and wire layers use the **service's own short name as that cloud knows it**: +### 2.2 `providers//` and `server//` — short service name, no cloud prefix +The mock and wire layers use the **service's own short name, without a cloud prefix** — +the real SDK/CLI name where a service clearly has one (`s3`, `ec2`, `elbv2`), and a short +capability name otherwise (`cache`, `dns`, `monitor`, `sql` — Azure's SDK spells these +`armredis`/`armdns`/`armmonitor`, but the short form reads better and stays prefix-free): | Capability | AWS | Azure | GCP | |---|---|---|---| | Storage | `s3` | `blobstorage` | `gcs` | -| Compute | `ec2` | `virtualmachines` | `gce` | +| Compute | `ec2` | `virtualmachines` | `compute` | | Networking | `vpc` | `vnet` | `vpc` | | IAM | `iam` | `iam` | `iam` | -| Load balancer | `elb` | `loadbalancer` | `loadbalancer` | +| Load balancer | `elbv2` | `loadbalancer` | `loadbalancer` | | Database (NoSQL) | `dynamodb` | `cosmosdb` | `firestore` | | DNS | `route53` | `dns` | `clouddns` | | Cache | `elasticache` | `cache` | `memorystore` | -| Monitoring | `cloudwatch` | `monitor` | `cloudmonitoring` | +| Monitoring | `cloudwatch` | `monitor` | `monitoring` | Two hard rules: @@ -70,9 +73,19 @@ Two hard rules: service map by name (e.g. `providers/azure/blobstorage` ↔ `server/azure/blobstorage`). > Names are **not** forced to be identical *across* clouds at the provider/wire layer — -> `s3` / `blobstorage` / `gcs` are each faithful to their own SDK, which is the point. +> `s3` / `blobstorage` / `gcs` each read naturally for their own cloud, which is the point. > Cross-cloud unification lives in the `services/` name only. +**Documented exceptions to the "provider ↔ wire same name" rule:** +- **AWS `providers/aws/vpc` ↔ `server/aws/ec2`.** AWS's own SDK folds VPC operations under + the EC2 service, so the wire handler lives in `ec2`; the mock keeps the clearer `vpc` name. + Pre-existing and intentional. +- **`services/azureai` / `services/azuresearch` keep the `azure` in their name**, while their + providers dropped it (`providers/azure/ai`, `providers/azure/search`). These are + **product-specific** services (Azure AI, Azure AI Search) with no cross-cloud abstraction, + so per §2.1 the product name — including the `azure` that is part of the product — is kept + at the `services/` layer. + --- ## 3. File naming (the rule) @@ -137,10 +150,13 @@ If you add a genuine portable-API service, it **must** have `driver/`. ## 5. Sub-surfaces → same-named subdirectories When a service grows a large or self-contained sub-surface, promote it to a -**same-named subdirectory in each layer** instead of a pile of flat files: +**same-named subdirectory in each layer** instead of a pile of flat files. +*Illustrative only* (no service is laid out this way today — see the flat-exception note +below; in the current tree traffic mirroring is the flat `providers/aws/vpc/traffic_mirror.go` +/ `server/aws/ec2/traffic_mirror.go`): ``` -services/networking/traffic_mirror/ # interface fragment +services/networking/traffic_mirror/ # interface fragment providers/aws/networking/traffic_mirror/ # mock server/aws/networking/traffic_mirror/ # wire ``` diff --git a/docs/architecture.md b/docs/architecture.md index 6e528c16..efc7ee06 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -135,7 +135,7 @@ services/ # emulated cloud services (portable API + compute/ database/ relationaldb/ serverless/ networking/ monitoring/ iam/ dns/ loadbalancer/ messagequeue/ cache/ secrets/ logging/ notification/ eventbus/ containerregistry/ kubernetes/ resourcediscovery/ - bedrock/ sagemaker/ vertexai/ databricks/ azureai/ azuresearch/ + bedrock/ sagemaker/ vertexai/ databricks/ ai/ search/ memorydb/ keyspaces/ managedcassandra/ ecs/ parameterstore/ tablestorage/ cost/ # each: .go (portable API) + driver/ (interface) @@ -155,7 +155,7 @@ providers/ lambda/ # Lambda mock vpc/ # VPC mock cloudwatch/ # CloudWatch mock - awsiam/ # IAM mock + iam/ # IAM mock route53/ # Route 53 mock elb/ # ELB mock sqs/ # SQS mock @@ -179,18 +179,18 @@ providers/ managedcassandra/ # Managed Instance for Apache Cassandra mock functions/ # Azure Functions mock vnet/ # VNet mock - azuremonitor/ # Azure Monitor mock - azureiam/ # Azure IAM mock - azuredns/ # Azure DNS mock - azurelb/ # Azure LB mock + monitor/ # Azure Monitor mock + iam/ # Azure IAM mock + dns/ # Azure DNS mock + loadbalancer/ # Azure LB mock servicebus/ # Service Bus mock - azurecache/ # Azure Cache mock + cache/ # Azure Cache mock keyvault/ # Key Vault mock loganalytics/ # Log Analytics mock notificationhubs/ # Notification Hubs mock acr/ # ACR mock eventgrid/ # Event Grid mock - azuresql/ # Azure SQL Database mock + sql/ # Azure SQL Database mock postgresflex/ # Azure PostgreSQL Flexible Server mock mysqlflex/ # Azure MySQL Flexible Server mock aks/ # AKS control-plane mock (managed clusters, @@ -198,14 +198,14 @@ providers/ gcp/ gcp.go # GCP factory (wires all services) gcs/ # GCS mock - gce/ # GCE mock + compute/ # GCE mock firestore/ # Firestore mock cloudfunctions/ # Cloud Functions mock - gcpvpc/ # GCP VPC mock - cloudmonitoring/ # Cloud Monitoring mock - gcpiam/ # GCP IAM mock + vpc/ # GCP VPC mock + monitoring/ # Cloud Monitoring mock + iam/ # GCP IAM mock clouddns/ # Cloud DNS mock - gcplb/ # GCP LB mock + loadbalancer/ # GCP LB mock pubsub/ # Pub/Sub mock memorystore/ # Memorystore mock secretmanager/ # Secret Manager mock @@ -235,7 +235,7 @@ server/ # SDK-compat HTTP servers (real cloud SDKs azure.go # azureserver.New(Drivers{...}) virtualmachines/ disks/ snapshots/ images/ sshpublickeys/ blob/ cosmos/ network/ monitor/ functions/ servicebus/ - azuresql/ postgresflex/ mysqlflex/ # ARM relational DB handlers + sql/ postgresflex/ mysqlflex/ # ARM relational DB handlers managedcassandra/ # ARM Managed Cassandra handler aks/ # ARM AKS control-plane handler gcp/ diff --git a/docs/sdk-server.md b/docs/sdk-server.md index 3371c1fe..e3fa0c89 100644 --- a/docs/sdk-server.md +++ b/docs/sdk-server.md @@ -250,7 +250,7 @@ server/ │ ├── azure.go # azureserver.New(Drivers{...}) │ ├── virtualmachines/ disks/ snapshots/ images/ sshpublickeys/ │ ├── blob/ cosmos/ network/ monitor/ functions/ servicebus/ -│ ├── azuresql/ postgresflex/ mysqlflex/ # ARM relational DB handlers +│ ├── sql/ postgresflex/ mysqlflex/ # ARM relational DB handlers │ ├── aks/ # ARM AKS control-plane handler │ └── databricks/ # ARM workspace + workspace data-plane families │ ├── secrets/ token/ gitcredentials/ repos/ dbfs/ wsfs/ diff --git a/docs/services.md b/docs/services.md index 06a7532f..cea0389b 100644 --- a/docs/services.md +++ b/docs/services.md @@ -7,23 +7,23 @@ This document lists every service and operation available in CloudEmu across all | # | Service Category | AWS | Azure | GCP | |---|-----------------|-----|-------|-----| | 1 | Storage | `s3` | `blobstorage` | `gcs` | -| 2 | Compute | `ec2` | `virtualmachines` | `gce` | +| 2 | Compute | `ec2` | `virtualmachines` | `compute` | | 3 | Database | `dynamodb` | `cosmosdb` | `firestore` | | 4 | Serverless | `lambda` | `functions` | `cloudfunctions` | -| 5 | Networking | `vpc` (+ AWS-specific: Transit Gateway, VPN, DHCP options, prefix lists, egress-only IGW, endpoint services, Client VPN, Traffic Mirroring, Network Insights, VPC Block Public Access) | `vnet` | `gcpvpc` | +| 5 | Networking | `vpc` (+ AWS-specific: Transit Gateway, VPN, DHCP options, prefix lists, egress-only IGW, endpoint services, Client VPN, Traffic Mirroring, Network Insights, VPC Block Public Access) | `vnet` | `vpc` | | 5a | Network Firewall | `network-firewall` | — | — | -| 6 | Monitoring | `cloudwatch` | `azuremonitor` | `cloudmonitoring` | -| 7 | IAM | `awsiam` | `azureiam` | `gcpiam` | -| 8 | DNS | `route53` | `azuredns` | `clouddns` | -| 9 | Load Balancer | `elb` | `azurelb` | `gcplb` | +| 6 | Monitoring | `cloudwatch` | `monitor` | `monitoring` | +| 7 | IAM | `iam` | `iam` | `iam` | +| 8 | DNS | `route53` | `dns` | `clouddns` | +| 9 | Load Balancer | `elb` | `loadbalancer` | `loadbalancer` | | 10 | Message Queue | `sqs` | `servicebus` | `pubsub` | -| 11 | Cache | `elasticache` | `azurecache` | `memorystore` | +| 11 | Cache | `elasticache` | `cache` | `memorystore` | | 12 | Secrets | `secretsmanager` | `keyvault` | `secretmanager` | | 13 | Logging | `cloudwatchlogs` | `loganalytics` | `cloudlogging` | | 14 | Notification | `sns` | `notificationhubs` | `fcm` | | 15 | Container Registry | `ecr` | `acr` | `artifactregistry` | | 16 | Event Bus | `eventbridge` | `eventgrid` | `eventarc` | -| 17 | Relational Database | `rds` (+ Aurora/Neptune/DocumentDB engines), `redshift` | `azuresql`, `postgresflex`, `mysqlflex` | `cloudsql`, `alloydb` | +| 17 | Relational Database | `rds` (+ Aurora/Neptune/DocumentDB engines), `redshift` | `sql`, `postgresflex`, `mysqlflex` | `cloudsql`, `alloydb` | | 17a | In-memory Database (Redis/Valkey) | `memorydb` | — | — | | 17b | Wide-column (Cassandra) | `keyspaces` | `managedcassandra` | — | | 17c | Wide-column (Bigtable) | — | — | `bigtable` | @@ -32,8 +32,8 @@ This document lists every service and operation available in CloudEmu across all | 19 | Resource Discovery | `resourceexplorer2` + `resourcegroupstaggingapi` | `resourcegraph` | `cloudasset` | | 20 | Generative AI | `bedrock` (+ `bedrock-runtime`), `bedrock-agent` (+ `bedrock-agent-runtime`) | — | — | | 21 | Databricks | — | `databricks` | — | -| 22 | Machine Learning | `sagemaker` (+ `sagemaker-runtime`) | `azureai` (CognitiveServices + MachineLearningServices) | `vertexai` | -| 23 | AI Search | — | `azuresearch` (Microsoft.Search) | — | +| 22 | Machine Learning | `sagemaker` (+ `sagemaker-runtime`) | `ai` (CognitiveServices + MachineLearningServices) | `vertexai` | +| 23 | AI Search | — | `search` (Microsoft.Search) | — | | 24 | Container Orchestration | `ecs` | — | — | --- @@ -1500,7 +1500,7 @@ a source cluster and detach on promote; clone-on-read on every path. ## 17. Relational Database **Driver interface:** `services/relationaldb/driver/driver.go` -**AWS:** `rds` (covers Aurora, Neptune, and DocumentDB engines), `redshift` | **Azure:** `azuresql`, `postgresflex`, `mysqlflex` | **GCP:** `cloudsql`, `alloydb` +**AWS:** `rds` (covers Aurora, Neptune, and DocumentDB engines), `redshift` | **Azure:** `sql`, `postgresflex`, `mysqlflex` | **GCP:** `cloudsql`, `alloydb` A single portable interface backs every RDBMS handler. Engine selection (MySQL / PostgreSQL / Aurora / Neptune / DocumentDB / Redshift / Cloud SQL / Azure SQL / AlloyDB / …) is a field on the input config, not a separate driver. @@ -1662,18 +1662,18 @@ cascade-delete children when their parent server/instance is deleted. | Capability | Operations | Implemented by | |-----------|-----------|----------------| | `Databases` | Create / Get / List / Delete | `mysqlflex`, `postgresflex`, `cloudsql`, `alloydb` | -| `FirewallRules` | Create / Get / List / Delete | `mysqlflex`, `postgresflex`, `azuresql` | +| `FirewallRules` | Create / Get / List / Delete | `mysqlflex`, `postgresflex`, `sql` | | `Configurations` | Set / Get / List (server parameters) | `mysqlflex`, `postgresflex` | | `Failover` | `FailoverInstance` | `mysqlflex`, `cloudsql` | -| `VNetRules` | Create / Get / List / Delete | `azuresql` | -| `ElasticPools` | Create / Get / List / Delete | `azuresql` | -| `FailoverGroups` | Create / Get / List / Delete / Failover | `azuresql` | -| `AADAdmins` | Set / Get / List / Delete | `azuresql` | +| `VNetRules` | Create / Get / List / Delete | `sql` | +| `ElasticPools` | Create / Get / List / Delete | `sql` | +| `FailoverGroups` | Create / Get / List / Delete / Failover | `sql` | +| `AADAdmins` | Set / Get / List / Delete | `sql` | | `Users` | Create / Get / List / Update / Delete | `cloudsql`, `alloydb` | | `SslCerts` | Create / Get / List / Delete | `cloudsql` | | `Clonable` | `CloneInstance` | `cloudsql` | | `ReplicaPromotion` | `PromoteReplica` | `cloudsql` | -| `ManagedInstances` | managed-instance CRUD + Start/Stop/Failover, managed-database CRUD/List | `azuresql` | +| `ManagedInstances` | managed-instance CRUD + Start/Stop/Failover, managed-database CRUD/List | `sql` | | `AlloyDB` | AlloyDB cluster/instance create, CreateSecondary/Promote, instance Failover/Restart, `*Info` accessors | `alloydb` | Cloud SQL also serves the `startReplica`/`stopReplica` instance actions (mapped @@ -2147,7 +2147,7 @@ rates integrate Vertex with the cross-cutting layers like every other service. ### Azure — Azure AI -**Driver interface:** `services/azureai/driver/` — spans both ARM providers plus the data planes. +**Driver interface:** `services/ai/driver/` — spans both ARM providers plus the data planes. **Azure:** Azure AI Foundry / AI Studio / Azure OpenAI (`Microsoft.CognitiveServices`) and Azure Machine Learning (`Microsoft.MachineLearningServices`). @@ -2176,7 +2176,7 @@ Azure Monitor via `SetMonitoring`. | AML scoring | online-endpoint `/score` data plane | Full Go API/driver, in-memory provider, SDK-compat ARM + data-plane HTTP server, a portable -Layer-1 wrapper (`azureai/azureai.go`), chaos injection (`chaos.WrapAzureAI`), and cost rates +Layer-1 wrapper (`ai/ai.go`), chaos injection (`chaos.WrapAzureAI`), and cost rates integrate Azure AI with the cross-cutting layers like every other service. **Total: 92 operations** (Go API/driver) — 31 CognitiveServices + 46 MachineLearningServices + 15 data plane — all exposed over the SDK-compat HTTP server. @@ -2185,7 +2185,7 @@ integrate Azure AI with the cross-cutting layers like every other service. ## 23. AI Search -**Driver interface:** `services/azuresearch/driver/` — `Microsoft.Search/searchServices` (ARM control +**Driver interface:** `services/search/driver/` — `Microsoft.Search/searchServices` (ARM control plane) plus the `{service}.search.windows.net` data plane. **Azure:** Azure AI Search (the RAG / retrieval backbone). **AWS / GCP:** _not applicable_. @@ -2207,7 +2207,7 @@ push to Azure Monitor via `SetMonitoring`. | Service statistics | counts + storage usage | Full Go API/driver, in-memory provider, SDK-compat ARM + data-plane HTTP server, a portable -Layer-1 wrapper (`azuresearch/azuresearch.go`), chaos injection (`chaos.WrapAzureSearch`), and +Layer-1 wrapper (`search/search.go`), chaos injection (`chaos.WrapAzureSearch`), and cost rates integrate Azure AI Search with the cross-cutting layers like every other service. **Total: 53 operations** (Go API/driver) — 19 control plane + 34 data plane. From 50d2d9c0c995f919130f95ff854f682a77daa3e7 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 6 Aug 2026 12:01:12 +0530 Subject: [PATCH 15/15] ci: actually inline the Structure check (ci.yml edit was missed in e8ecffc) (#325) --- .github/workflows/ci.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf7f2887..b35c607d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,29 @@ jobs: steps: - uses: actions/checkout@v4 - name: naming & layout convention (docs/STRUCTURE.md) - run: bash scripts/check_structure.sh + run: | + # No cloud-prefixed directory at ANY depth under providers/ or + # server/ — the parent aws/azure/gcp already encodes the cloud, + # so the prefix is redundant (docs/STRUCTURE.md §2.2). Recursive so a + # promoted sub-surface subdir (§4/§5) can't smuggle a prefix back in. + fail=0 + for cloud in aws azure gcp; do + for layer in providers server; do + [ -d "$layer/$cloud" ] || continue + for d in $(find "$layer/$cloud" -mindepth 1 -type d); do + case "$(basename "$d")" in + "$cloud"?*) + echo "structure: '$d' has a redundant '$cloud' prefix — drop it (docs/STRUCTURE.md §2.2)" + fail=1 ;; + esac + done + done + done + if [ "$fail" -ne 0 ]; then + echo "Structure check failed. See docs/STRUCTURE.md." + exit 1 + fi + echo "structure: no cloud-prefixed provider/wire directories — OK" format: name: Format