diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41083f36..b35c607d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,6 +107,36 @@ 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: | + # 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 runs-on: ubuntu-latest 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) diff --git a/docs/STRUCTURE.md b/docs/STRUCTURE.md new file mode 100644 index 00000000..2cc658d7 --- /dev/null +++ b/docs/STRUCTURE.md @@ -0,0 +1,210 @@ +# 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//` — 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` | `compute` | +| Networking | `vpc` | `vnet` | `vpc` | +| IAM | `iam` | `iam` | `iam` | +| Load balancer | `elbv2` | `loadbalancer` | `loadbalancer` | +| Database (NoSQL) | `dynamodb` | `cosmosdb` | `firestore` | +| DNS | `route53` | `dns` | `clouddns` | +| Cache | `elasticache` | `cache` | `memorystore` | +| Monitoring | `cloudwatch` | `monitor` | `monitoring` | + +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` 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) + +- **`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. +*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 +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. + +### 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 + +**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/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. 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/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..ddc068b1 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/awsiam" "github.com/stackshy/cloudemu/v2/providers/aws/bedrock" "github.com/stackshy/cloudemu/v2/providers/aws/bedrockagent" "github.com/stackshy/cloudemu/v2/providers/aws/bedrockagentruntime" @@ -20,8 +19,9 @@ 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" "github.com/stackshy/cloudemu/v2/providers/aws/lambda" "github.com/stackshy/cloudemu/v2/providers/aws/memorydb" @@ -122,9 +122,9 @@ type Provider struct { Lambda *lambda.Mock VPC *vpc.Mock CloudWatch *cloudwatch.Mock - IAM *awsiam.Mock + IAM *iam.Mock Route53 *route53.Mock - ELB *elb.Mock + ELB *elbv2.Mock SQS *sqs.Mock ElastiCache *elasticache.Mock Keyspaces *keyspaces.Mock @@ -159,9 +159,9 @@ 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), + ELB: elbv2.New(o), SQS: sqs.New(o), ElastiCache: elasticache.New(o), Keyspaces: keyspaces.New(o), 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/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/aws/awsiam/iam.go b/providers/aws/iam/iam.go similarity index 99% rename from providers/aws/awsiam/iam.go rename to providers/aws/iam/iam.go index da0853cb..52c11b88 100644 --- a/providers/aws/awsiam/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/awsiam/iam_test.go b/providers/aws/iam/iam_test.go similarity index 99% rename from providers/aws/awsiam/iam_test.go rename to providers/aws/iam/iam_test.go index 9fad4004..f57a5f0d 100644 --- a/providers/aws/awsiam/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/awsiam/managedpolicy.go b/providers/aws/iam/managed_policy.go similarity index 99% rename from providers/aws/awsiam/managedpolicy.go rename to providers/aws/iam/managed_policy.go index 892be045..dc26a94d 100644 --- a/providers/aws/awsiam/managedpolicy.go +++ b/providers/aws/iam/managed_policy.go @@ -1,4 +1,4 @@ -package awsiam +package iam import ( "strings" diff --git a/providers/aws/awsiam/managedpolicy_test.go b/providers/aws/iam/managed_policy_test.go similarity index 99% rename from providers/aws/awsiam/managedpolicy_test.go rename to providers/aws/iam/managed_policy_test.go index 079ebbd0..9952dc87 100644 --- a/providers/aws/awsiam/managedpolicy_test.go +++ b/providers/aws/iam/managed_policy_test.go @@ -1,4 +1,4 @@ -package awsiam +package iam import ( "context" diff --git a/providers/aws/awsiam/rolepolicy.go b/providers/aws/iam/role_policy.go similarity index 99% rename from providers/aws/awsiam/rolepolicy.go rename to providers/aws/iam/role_policy.go index f7704836..c04359b7 100644 --- a/providers/aws/awsiam/rolepolicy.go +++ b/providers/aws/iam/role_policy.go @@ -1,4 +1,4 @@ -package awsiam +package iam import ( "context" diff --git a/providers/aws/awsiam/roletags.go b/providers/aws/iam/roletags.go similarity index 98% rename from providers/aws/awsiam/roletags.go rename to providers/aws/iam/roletags.go index ab079dba..6cd39dbb 100644 --- a/providers/aws/awsiam/roletags.go +++ b/providers/aws/iam/roletags.go @@ -1,4 +1,4 @@ -package awsiam +package iam import ( "context" 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/azureai/azureai.go b/providers/azure/ai/ai.go similarity index 99% rename from providers/azure/azureai/azureai.go rename to providers/azure/ai/ai.go index 7012c3ef..4b619940 100644 --- a/providers/azure/azureai/azureai.go +++ b/providers/azure/ai/ai.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/azureai/cognitiveservices.go b/providers/azure/ai/cognitive_services.go similarity index 99% rename from providers/azure/azureai/cognitiveservices.go rename to providers/azure/ai/cognitive_services.go index 7d0d5c0c..484c7ed2 100644 --- a/providers/azure/azureai/cognitiveservices.go +++ b/providers/azure/ai/cognitive_services.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "context" diff --git a/providers/azure/azureai/dataplane.go b/providers/azure/ai/dataplane.go similarity index 99% rename from providers/azure/azureai/dataplane.go rename to providers/azure/ai/dataplane.go index be8f8193..3c43c44c 100644 --- a/providers/azure/azureai/dataplane.go +++ b/providers/azure/ai/dataplane.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "context" diff --git a/providers/azure/azureai/machinelearning.go b/providers/azure/ai/machine_learning.go similarity index 99% rename from providers/azure/azureai/machinelearning.go rename to providers/azure/ai/machine_learning.go index 694686d8..fcc94502 100644 --- a/providers/azure/azureai/machinelearning.go +++ b/providers/azure/ai/machine_learning.go @@ -1,4 +1,4 @@ -package azureai +package ai import ( "context" diff --git a/providers/azure/azureai/machinelearning_more.go b/providers/azure/ai/machine_learning_more.go similarity index 99% rename from providers/azure/azureai/machinelearning_more.go rename to providers/azure/ai/machine_learning_more.go index f945aebb..20d08a70 100644 --- a/providers/azure/azureai/machinelearning_more.go +++ b/providers/azure/ai/machine_learning_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..59dbcf70 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/ai" "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/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" @@ -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 + AI *ai.Mock + Search *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), + 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, @@ -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/azurecache/azurecache.go b/providers/azure/cache/cache.go similarity index 99% rename from providers/azure/azurecache/azurecache.go rename to providers/azure/cache/cache.go index 95073b85..20a50a7c 100644 --- a/providers/azure/azurecache/azurecache.go +++ b/providers/azure/cache/cache.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/azurecache/azurecache_test.go b/providers/azure/cache/cache_test.go similarity index 99% rename from providers/azure/azurecache/azurecache_test.go rename to providers/azure/cache/cache_test.go index 1d963f62..a39f6be2 100644 --- a/providers/azure/azurecache/azurecache_test.go +++ b/providers/azure/cache/cache_test.go @@ -1,4 +1,4 @@ -package azurecache +package cache import ( "context" diff --git a/providers/azure/azurecache/ordering_test.go b/providers/azure/cache/ordering_test.go similarity index 98% rename from providers/azure/azurecache/ordering_test.go rename to providers/azure/cache/ordering_test.go index c6a57dd3..8e3fef30 100644 --- a/providers/azure/azurecache/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/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/azuredns/dns.go b/providers/azure/dns/dns.go similarity index 99% rename from providers/azure/azuredns/dns.go rename to providers/azure/dns/dns.go index 63222e11..dd15056e 100644 --- a/providers/azure/azuredns/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/azuredns/dns_test.go b/providers/azure/dns/dns_test.go similarity index 99% rename from providers/azure/azuredns/dns_test.go rename to providers/azure/dns/dns_test.go index 16999ed4..5fba0ae7 100644 --- a/providers/azure/azuredns/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/azuredns/healthcheck.go b/providers/azure/dns/health_check.go similarity index 99% rename from providers/azure/azuredns/healthcheck.go rename to providers/azure/dns/health_check.go index bdf66efa..5b14bf6a 100644 --- a/providers/azure/azuredns/healthcheck.go +++ b/providers/azure/dns/health_check.go @@ -1,4 +1,4 @@ -package azuredns +package dns import ( "context" diff --git a/providers/azure/azuredns/ordering_test.go b/providers/azure/dns/ordering_test.go similarity index 99% rename from providers/azure/azuredns/ordering_test.go rename to providers/azure/dns/ordering_test.go index 85663bba..678fff87 100644 --- a/providers/azure/azuredns/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/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/azureiam/iam.go b/providers/azure/iam/iam.go similarity index 99% rename from providers/azure/azureiam/iam.go rename to providers/azure/iam/iam.go index 1dafde8c..805975e7 100644 --- a/providers/azure/azureiam/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/azureiam/iam_test.go b/providers/azure/iam/iam_test.go similarity index 99% rename from providers/azure/azureiam/iam_test.go rename to providers/azure/iam/iam_test.go index e0c3a0ae..648109ee 100644 --- a/providers/azure/azureiam/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/azurelb/lb.go b/providers/azure/loadbalancer/lb.go similarity index 99% rename from providers/azure/azurelb/lb.go rename to providers/azure/loadbalancer/lb.go index c257fe44..f251a0e4 100644 --- a/providers/azure/azurelb/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/azurelb/lb_test.go b/providers/azure/loadbalancer/lb_test.go similarity index 99% rename from providers/azure/azurelb/lb_test.go rename to providers/azure/loadbalancer/lb_test.go index defc2f75..ceca4d20 100644 --- a/providers/azure/azurelb/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/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/azuremonitor/monitor.go b/providers/azure/monitor/monitor.go similarity index 99% rename from providers/azure/azuremonitor/monitor.go rename to providers/azure/monitor/monitor.go index 493c9783..4887d131 100644 --- a/providers/azure/azuremonitor/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/azuremonitor/monitor_test.go b/providers/azure/monitor/monitor_test.go similarity index 99% rename from providers/azure/azuremonitor/monitor_test.go rename to providers/azure/monitor/monitor_test.go index cd056373..62ecdd28 100644 --- a/providers/azure/azuremonitor/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/azuresearch/control_keys.go b/providers/azure/search/control_keys.go similarity index 99% rename from providers/azure/azuresearch/control_keys.go rename to providers/azure/search/control_keys.go index 89686ce5..99ce0406 100644 --- a/providers/azure/azuresearch/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/azuresearch/dataplane.go b/providers/azure/search/dataplane.go similarity index 99% rename from providers/azure/azuresearch/dataplane.go rename to providers/azure/search/dataplane.go index ead5e812..f980eb9e 100644 --- a/providers/azure/azuresearch/dataplane.go +++ b/providers/azure/search/dataplane.go @@ -1,4 +1,4 @@ -package azuresearch +package search import ( "context" diff --git a/providers/azure/azuresearch/dataplane_more.go b/providers/azure/search/dataplane_more.go similarity index 99% rename from providers/azure/azuresearch/dataplane_more.go rename to providers/azure/search/dataplane_more.go index 9b3cf497..dffd7ad1 100644 --- a/providers/azure/azuresearch/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/azuresearch/azuresearch.go b/providers/azure/search/search.go similarity index 98% rename from providers/azure/azuresearch/azuresearch.go rename to providers/azure/search/search.go index 610ee5af..9d136257 100644 --- a/providers/azure/azuresearch/azuresearch.go +++ b/providers/azure/search/search.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/azuresql/databases.go b/providers/azure/sql/databases.go similarity index 99% rename from providers/azure/azuresql/databases.go rename to providers/azure/sql/databases.go index ec50de4c..a3467817 100644 --- a/providers/azure/azuresql/databases.go +++ b/providers/azure/sql/databases.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "context" diff --git a/providers/azure/azuresql/databases_cost_test.go b/providers/azure/sql/databases_cost_test.go similarity index 99% rename from providers/azure/azuresql/databases_cost_test.go rename to providers/azure/sql/databases_cost_test.go index ac6c8dae..96dcd1de 100644 --- a/providers/azure/azuresql/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/azuresql/managedinstance.go b/providers/azure/sql/managed_instance.go similarity index 99% rename from providers/azure/azuresql/managedinstance.go rename to providers/azure/sql/managed_instance.go index a4549ec9..ce537857 100644 --- a/providers/azure/azuresql/managedinstance.go +++ b/providers/azure/sql/managed_instance.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "context" diff --git a/providers/azure/azuresql/azuresql.go b/providers/azure/sql/sql.go similarity index 99% rename from providers/azure/azuresql/azuresql.go rename to providers/azure/sql/sql.go index 0d9239f7..1b2b5130 100644 --- a/providers/azure/azuresql/azuresql.go +++ b/providers/azure/sql/sql.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/azuresql/azuresql_test.go b/providers/azure/sql/sql_test.go similarity index 99% rename from providers/azure/azuresql/azuresql_test.go rename to providers/azure/sql/sql_test.go index 5dac686c..2ac669db 100644 --- a/providers/azure/azuresql/azuresql_test.go +++ b/providers/azure/sql/sql_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/azuresql/subresources.go b/providers/azure/sql/subresources.go similarity index 99% rename from providers/azure/azuresql/subresources.go rename to providers/azure/sql/subresources.go index 68531bd5..fccce6a8 100644 --- a/providers/azure/azuresql/subresources.go +++ b/providers/azure/sql/subresources.go @@ -1,4 +1,4 @@ -package azuresql +package sql import ( "bytes" 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/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/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/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 e52ee669..35a21bc3 100644 --- a/providers/gcp/gcp.go +++ b/providers/gcp/gcp.go @@ -11,21 +11,21 @@ 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/gcpiam" - "github.com/stackshy/cloudemu/v2/providers/gcp/gcplb" - "github.com/stackshy/cloudemu/v2/providers/gcp/gcpvpc" "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" + "github.com/stackshy/cloudemu/v2/providers/gcp/vpc" "github.com/stackshy/cloudemu/v2/services/resourcediscovery" ) @@ -58,14 +58,14 @@ 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 *gcpvpc.Mock - CloudMonitoring *cloudmonitoring.Mock - IAM *gcpiam.Mock + VPC *vpc.Mock + CloudMonitoring *monitoring.Mock + IAM *iam.Mock CloudDNS *clouddns.Mock - LB *gcplb.Mock + LB *loadbalancer.Mock PubSub *pubsub.Mock Memorystore *memorystore.Mock SecretManager *secretmanager.Mock @@ -93,14 +93,14 @@ 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: gcpvpc.New(o), - CloudMonitoring: cloudmonitoring.New(o), - IAM: gcpiam.New(o), + VPC: vpc.New(o), + CloudMonitoring: monitoring.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/gcpiam/iam.go b/providers/gcp/iam/iam.go similarity index 99% rename from providers/gcp/gcpiam/iam.go rename to providers/gcp/iam/iam.go index 58c97d07..be4ef237 100644 --- a/providers/gcp/gcpiam/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/gcpiam/iam_test.go b/providers/gcp/iam/iam_test.go similarity index 99% rename from providers/gcp/gcpiam/iam_test.go rename to providers/gcp/iam/iam_test.go index e63f66cb..e97bf611 100644 --- a/providers/gcp/gcpiam/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/gcplb/lb.go b/providers/gcp/loadbalancer/lb.go similarity index 99% rename from providers/gcp/gcplb/lb.go rename to providers/gcp/loadbalancer/lb.go index 8f57beb1..5fd3cb22 100644 --- a/providers/gcp/gcplb/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/gcplb/lb_test.go b/providers/gcp/loadbalancer/lb_test.go similarity index 99% rename from providers/gcp/gcplb/lb_test.go rename to providers/gcp/loadbalancer/lb_test.go index 016f009e..fa22c46e 100644 --- a/providers/gcp/gcplb/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/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/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/gcpvpc/acl.go b/providers/gcp/vpc/acl.go similarity index 99% rename from providers/gcp/gcpvpc/acl.go rename to providers/gcp/vpc/acl.go index f7b675e4..f3749425 100644 --- a/providers/gcp/gcpvpc/acl.go +++ b/providers/gcp/vpc/acl.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/gcpvpc/eip.go b/providers/gcp/vpc/elastic_ip.go similarity index 99% rename from providers/gcp/gcpvpc/eip.go rename to providers/gcp/vpc/elastic_ip.go index 5b327c87..47a27ea3 100644 --- a/providers/gcp/gcpvpc/eip.go +++ b/providers/gcp/vpc/elastic_ip.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/gcpvpc/endpoint.go b/providers/gcp/vpc/endpoint.go similarity index 99% rename from providers/gcp/gcpvpc/endpoint.go rename to providers/gcp/vpc/endpoint.go index 6c2c1e7a..4f0f11a9 100644 --- a/providers/gcp/gcpvpc/endpoint.go +++ b/providers/gcp/vpc/endpoint.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/gcpvpc/flowlog.go b/providers/gcp/vpc/flowlog.go similarity index 99% rename from providers/gcp/gcpvpc/flowlog.go rename to providers/gcp/vpc/flowlog.go index b99b51ff..a1493135 100644 --- a/providers/gcp/gcpvpc/flowlog.go +++ b/providers/gcp/vpc/flowlog.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/gcpvpc/igw.go b/providers/gcp/vpc/internet_gateway.go similarity index 99% rename from providers/gcp/gcpvpc/igw.go rename to providers/gcp/vpc/internet_gateway.go index 076f6a1f..bca78c18 100644 --- a/providers/gcp/gcpvpc/igw.go +++ b/providers/gcp/vpc/internet_gateway.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/gcpvpc/natgw.go b/providers/gcp/vpc/nat_gateway.go similarity index 99% rename from providers/gcp/gcpvpc/natgw.go rename to providers/gcp/vpc/nat_gateway.go index 22c7c321..2d5cb741 100644 --- a/providers/gcp/gcpvpc/natgw.go +++ b/providers/gcp/vpc/nat_gateway.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/gcpvpc/peering.go b/providers/gcp/vpc/peering.go similarity index 99% rename from providers/gcp/gcpvpc/peering.go rename to providers/gcp/vpc/peering.go index 809a5f43..f31931ac 100644 --- a/providers/gcp/gcpvpc/peering.go +++ b/providers/gcp/vpc/peering.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/gcpvpc/routetable.go b/providers/gcp/vpc/route_table.go similarity index 99% rename from providers/gcp/gcpvpc/routetable.go rename to providers/gcp/vpc/route_table.go index 0e352e27..76c7aa40 100644 --- a/providers/gcp/gcpvpc/routetable.go +++ b/providers/gcp/vpc/route_table.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/gcpvpc/rtassoc.go b/providers/gcp/vpc/rtassoc.go similarity index 99% rename from providers/gcp/gcpvpc/rtassoc.go rename to providers/gcp/vpc/rtassoc.go index 0837af04..c78688f6 100644 --- a/providers/gcp/gcpvpc/rtassoc.go +++ b/providers/gcp/vpc/rtassoc.go @@ -1,4 +1,4 @@ -package gcpvpc +package vpc import ( "context" diff --git a/providers/gcp/gcpvpc/vpc.go b/providers/gcp/vpc/vpc.go similarity index 99% rename from providers/gcp/gcpvpc/vpc.go rename to providers/gcp/vpc/vpc.go index 9278cb88..95b8aa52 100644 --- a/providers/gcp/gcpvpc/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/gcpvpc/vpc_test.go b/providers/gcp/vpc/vpc_test.go similarity index 99% rename from providers/gcp/gcpvpc/vpc_test.go rename to providers/gcp/vpc/vpc_test.go index d0bd023d..2dc43803 100644 --- a/providers/gcp/gcpvpc/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/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/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/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/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/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/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..a6c46ce2 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" @@ -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/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/machine_learning.go similarity index 99% rename from server/azure/azureai/machinelearning.go rename to server/azure/ai/machine_learning.go index 2d1b8ed5..a1064a5b 100644 --- a/server/azure/azureai/machinelearning.go +++ b/server/azure/ai/machine_learning.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..55d84a5c 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" @@ -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/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..ee046c73 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" @@ -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/azure.go b/server/azure/azure.go index 7c57abbb..e22a9fd0 100644 --- a/server/azure/azure.go +++ b/server/azure/azure.go @@ -9,14 +9,12 @@ package azure import ( "github.com/stackshy/cloudemu/v2/server" "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" - 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" - "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" @@ -45,19 +43,21 @@ 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" "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" - 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 @@ -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 @@ -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/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 94% rename from server/azure/fromprovider.go rename to server/azure/from_provider.go index 64ba07d2..72502e18 100644 --- a/server/azure/fromprovider.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/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/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 98% rename from server/azure/azuresearch/sdk_roundtrip_test.go rename to server/azure/search/sdk_roundtrip_test.go index 68c5421d..3f21b848 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" @@ -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) 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/managed_instance.go similarity index 99% rename from server/azure/azuresql/managedinstance.go rename to server/azure/sql/managed_instance.go index f8ea27b4..9942b089 100644 --- a/server/azure/azuresql/managedinstance.go +++ b/server/azure/sql/managed_instance.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" 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/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/gcp.go b/server/gcp/gcp.go index 1a33d116..5014d746 100644 --- a/server/gcp/gcp.go +++ b/server/gcp/gcp.go @@ -28,11 +28,11 @@ import ( "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" @@ -146,7 +146,7 @@ func New(d Drivers) *server.Server { } 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 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 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. 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/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/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" ) 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