internal/

directory
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: Apache-2.0

Directories

Path Synopsis
Package admin holds the OpenAPI description of the /_emu/v1/ admin API (SRS 7.3), embedded in the binary for `gcpemu admin openapi`.
Package admin holds the OpenAPI description of the /_emu/v1/ admin API (SRS 7.3), embedded in the binary for `gcpemu admin openapi`.
Package agent runs gcpemu helper processes inside containers the emulator launches (GKE node metadata proxy, Cloud SQL server-side proxy).
Package agent runs gcpemu helper processes inside containers the emulator launches (GKE node metadata proxy, Cloud SQL server-side proxy).
Package apidef holds the API surface generated from Google's published definitions (NFR-MNT-001): the google.api.http routes and field behaviours (AIP-203) of the gRPC APIs, read from googleapis at the commit pinned in apis.yaml, and the methods and field annotations of the discovery (JSON/REST) APIs, read from the discovery documents vendored in the google.golang.org/api module pinned in go.mod.
Package apidef holds the API surface generated from Google's published definitions (NFR-MNT-001): the google.api.http routes and field behaviours (AIP-203) of the gRPC APIs, read from googleapis at the commit pinned in apis.yaml, and the methods and field annotations of the discovery (JSON/REST) APIs, read from the discovery documents vendored in the google.golang.org/api module pinned in go.mod.
internal/apigen command
Command apigen generates internal/apidef's route and field-behaviour tables (NFR-MNT-001) from Google's published API definitions:
Command apigen generates internal/apidef's route and field-behaviour tables (NFR-MNT-001) from Google's published API definitions:
Package apierr models GCP API errors and renders them as the JSON error envelope used by REST APIs and as google.rpc.Status for gRPC (FR-CORE-025).
Package apierr models GCP API errors and renders them as the JSON error envelope used by REST APIs and as google.rpc.Status for gRPC (FR-CORE-025).
Package ca is the emulator's local certificate authority (Section 7.4).
Package ca is the emulator's local certificate authority (Section 7.4).
Package cli implements the gcpemu command line (FR-CORE-001..007).
Package cli implements the gcpemu command line (FR-CORE-001..007).
Package clock provides the Emulator clock (NFR-REL-002): real by default, or under --deterministic a fake clock that moves once per API request.
Package clock provides the Emulator clock (NFR-REL-002): real by default, or under --deterministic a fake clock that moves once per API request.
Package config loads emulator configuration with the precedence flags > env (GCPEMU_*) > gcpemu.yaml > defaults (FR-CORE-010).
Package config loads emulator configuration with the precedence flags > env (GCPEMU_*) > gcpemu.yaml > defaults (FR-CORE-010).
Package edgeagent is the Edge relay's Sidecar agent, which relays TCP connections to an ingress in the emulator with a PROXY v2 header, and the LAN relay containers that run it in LAN mode on the host network: lb-lan for --lb-bind and gfe-lan, the LAN front-end relay, for --gfe-bind.
Package edgeagent is the Edge relay's Sidecar agent, which relays TCP connections to an ingress in the emulator with a PROXY v2 header, and the LAN relay containers that run it in LAN mode on the host network: lb-lan for --lb-bind and gfe-lan, the LAN front-end relay, for --gfe-bind.
Package emu defines the contract between the emulator core and service modules (NFR-MNT-002) and the shared environment they run in.
Package emu defines the contract between the emulator core and service modules (NFR-MNT-002) and the shared environment they run in.
Package emutestx holds test helpers about gcpemu's own internals, for gcpemu's tests only: they inspect an emutest.Instance's VM relay.
Package emutestx holds test helpers about gcpemu's own internals, for gcpemu's tests only: they inspect an emutest.Instance's VM relay.
Package escapeguard is the Escape guard (see CONTEXT.md): a proxy that OpenTofu and gcloud runs in the acceptance tests go through, so that an Escaped request fails the test, naming the host, instead of reaching Google.
Package escapeguard is the Escape guard (see CONTEXT.md): a proxy that OpenTofu and gcloud runs in the acceptance tests go through, so that an Escaped request fails the test, naming the host, instead of reaching Google.
Package events is the Instance's change feed, served as server-sent events at /_emu/v1/events (FR-CORE-045, FR-UI-006): resource changes, Operation progress, Request log entries and IAM denials.
Package events is the Instance's change feed, served as server-sent events at /_emu/v1/events (FR-CORE-045, FR-UI-006): resource changes, Operation progress, Request log entries and IAM denials.
Package fault implements fault injection rules (FR-CORE-060): inject an error code, latency or a dropped connection by service, method, resource pattern and probability or count.
Package fault implements fault injection rules (FR-CORE-060): inject an error code, latency or a dropped connection by service, method, resource pattern and probability or count.
Package filelock takes exclusive OS locks on files, which the OS drops when the holding process dies.
Package filelock takes exclusive OS locks on files, which the OS drops when the holding process dies.
Package frontend is the emulator's "Google front end": a TLS terminator that lets unmodified clients reach emulated services by their real hostnames (storage.googleapis.com, pubsub.googleapis.com, LOCATION-docker.pkg.dev, ...) over HTTPS, HTTP/2 and gRPC (FR-INT-007, FR-CORE-043).
Package frontend is the emulator's "Google front end": a TLS terminator that lets unmodified clients reach emulated services by their real hostnames (storage.googleapis.com, pubsub.googleapis.com, LOCATION-docker.pkg.dev, ...) over HTTPS, HTTP/2 and gRPC (FR-INT-007, FR-CORE-043).
Package gateway is the control-plane gateway (FR-CORE-040): one listener serving every API over HTTP/1.1 REST and gRPC (h2c), routing by path prefix and Host, authenticating callers and recording the request log.
Package gateway is the control-plane gateway (FR-CORE-040): one listener serving every API over HTTP/1.1 REST and gRPC (h2c), routing by path prefix and Host, authenticating callers and recording the request log.
Package hostmode implements host mode (FR-CORE-043): host processes reach emulated services by their real hostnames (storage.googleapis.com, LOCATION-docker.pkg.dev, ...) once the local CA is trusted.
Package hostmode implements host mode (FR-CORE-043): host processes reach emulated services by their real hostnames (storage.googleapis.com, LOCATION-docker.pkg.dev, ...) once the local CA is trusted.
Package hosttest holds helpers for tests that drive gcpemu from the host through the docker CLI and the clients' environment, for gcpemu's own tests only: the Containerized Instance tests and the Pre-release host checks.
Package hosttest holds helpers for tests that drive gcpemu from the host through the docker CLI and the clients' environment, for gcpemu's own tests only: the Containerized Instance tests and the Pre-release host checks.
Package inflight tracks a service's background work across Instance Resets.
Package inflight tracks a service's background work across Instance Resets.
Package instance assembles and runs one emulator instance: state store, gateway, admin API and the selected services.
Package instance assembles and runs one emulator instance: state store, gateway, admin API and the selected services.
Package lanbind holds what the emulator says about the --lb-bind, --gke-bind, --ar-bind, --gfe-bind, --sql-bind and --link-bind addresses in a Containerized Instance, in one place so that start, the Services and doctor say the same (#497, ADR 0011).
Package lanbind holds what the emulator says about the --lb-bind, --gke-bind, --ar-bind, --gfe-bind, --sql-bind and --link-bind addresses in a Containerized Instance, in one place so that start, the Services and doctor say the same (#497, ADR 0011).
Package lbenv derives the `gcpemu env` variables of load balancing endpoints (ADR 0013): forwarding rules' GCPEMU_LB_* and GKE LoadBalancer Service ports' GCPEMU_GKE_*, from their Service endpoint names.
Package lbenv derives the `gcpemu env` variables of load balancing endpoints (ADR 0013): forwarding rules' GCPEMU_LB_* and GKE LoadBalancer Service ports' GCPEMU_GKE_*, from their Service endpoint names.
Package link connects an Instance to Linked Instances (ADR 0027).
Package link connects an Instance to Linked Instances (ADR 0027).
Package listfilter evaluates the filter of a list call, as gcloud and the client libraries send it: field OP value terms (value bare or double-quoted) combined with AND, OR, NOT and parentheses, adjacent terms ANDed.
Package listfilter evaluates the filter of a list call, as gcloud and the client libraries send it: field OP value terms (value bare or double-quoted) combined with AND, OR, NOT and parentheses, adjacent terms ANDed.
Package listpage pages a list call's results by offset.
Package listpage pages a list call's results by offset.
Package locations embeds the real Google Cloud regions and zones (FR-CORE-021) so every service validates locations the same way.
Package locations embeds the real Google Cloud regions and zones (FR-CORE-021) so every service validates locations the same way.
Package loopback reports whether the host has loopback addresses beyond 127.0.0.1 (ADR 0005), and on macOS whether each is a /32.
Package loopback reports whether the host has loopback addresses beyond 127.0.0.1 (ADR 0005), and on macOS whether each is a /32.
Package lro implements google.longrunning Operations for services whose mutations are long-running in GCP (FR-CORE-023).
Package lro implements google.longrunning Operations for services whose mutations are long-running in GCP (FR-CORE-023).
Package mdns advertises and browses DNS-SD services over multicast DNS (RFC 6762, RFC 6763), over IPv4, as Linked Instances find each other on the LAN (ADR 0027).
Package mdns advertises and browses DNS-SD services over multicast DNS (RFC 6762, RFC 6763), over IPv4, as Linked Instances find each other on the LAN (ADR 0027).
Package netplane connects the emulator process to the container networks it creates (Section 3.3).
Package netplane connects the emulator process to the container networks it creates (Section 3.3).
Package porttest picks free ports for gcpemu's own tests.
Package porttest picks free ports for gcpemu's own tests.
Package project implements project identity (FR-CORE-020): any project ID is accepted, and its number is derived deterministically from the ID.
Package project implements project identity (FR-CORE-020): any project ID is accepted, and its number is derived deterministically from the ID.
Package published chooses the Published ports (ADR 0012) a Containerized Instance serves host clients on: the ports its own container publishes to the host.
Package published chooses the Published ports (ADR 0012) a Containerized Instance serves host clients on: the ports its own container publishes to the host.
Package registryrelay implements the Registry relay (ADR 0043).
Package registryrelay implements the Registry relay (ADR 0043).
Package reqlog records every API call and data-plane request as a structured entry (FR-CORE-061) and keeps the most recent ones in memory for the admin API (FR-CORE-045).
Package reqlog records every API call and data-plane request as a structured entry (FR-CORE-061) and keeps the most recent ones in memory for the admin API (FR-CORE-045).
Package runtime is the container runtime driver (Section 3.1): a small client for the Docker Engine API, which Docker Engine and Podman (its Docker-compatible socket) both serve.
Package runtime is the container runtime driver (Section 3.1): a small client for the Docker Engine API, which Docker Engine and Podman (its Docker-compatible socket) both serve.
Package sonobuoytest runs Kubernetes conformance, Sonobuoy's quick mode, for gcpemu's own tests: the Autopilot acceptance (e2e) on Autopilot clusters and TestKubeConformance (compat) on Standard clusters.
Package sonobuoytest runs Kubernetes conformance, Sonobuoy's quick mode, for gcpemu's own tests: the Autopilot acceptance (e2e) on Autopilot clusters and TestKubeConformance (compat) on Standard clusters.
Package store is the control-plane state store (FR-CORE-032): a small transactional, namespaced key-value interface with an in-memory implementation for --ephemeral and a bbolt (pure Go) one for --data-dir.
Package store is the control-plane state store (FR-CORE-032): a small transactional, namespaced key-value interface with an in-memory implementation for --ephemeral and a bbolt (pure Go) one for --data-dir.
Package transcode serves the REST surface of gRPC services: it maps the google.api.http bindings generated into internal/apidef onto the services' gRPC implementations (AIP-127), validating each request's field behaviours on the way in.
Package transcode serves the REST surface of gRPC services: it maps the google.api.http bindings generated into internal/apidef onto the services' gRPC implementations (AIP-127), validating each request's field behaviours on the way in.
Package trust builds CA bundles that combine the host's system roots with the emulator's local CA (Section 7.4), for clients that read a single bundle file: SSL_CERT_FILE from `gcpemu env --trust` (FR-CORE-004) and the bundle injected into GKE pods (FR-INT-007).
Package trust builds CA bundles that combine the host's system roots with the emulator's local CA (Section 7.4), for clients that read a single bundle file: SSL_CERT_FILE from `gcpemu env --trust` (FR-CORE-004) and the bundle injected into GKE pods (FR-INT-007).
Package vmrelay implements the VM relay (ADR 0005).
Package vmrelay implements the VM relay (ADR 0005).
Package webconsole serves the Web console's bundle on the gateway under /console (FR-UI-002).
Package webconsole serves the Web console's bundle on the gateway under /console (FR-UI-002).
Package workload holds what the emulator gives the containers that run users' code as on GCP, GKE pods and Build steps, so that unmodified clients reach the Instance by real hostname as a service account: the metadata and registry proxies their Sidecar agents serve, the DNS answers that send Google hostnames to the Sidecar agent's :443 relay to the Google front end, and the names of the Instance CA bundle and its variables.
Package workload holds what the emulator gives the containers that run users' code as on GCP, GKE pods and Build steps, so that unmodified clients reach the Instance by real hostname as a service account: the metadata and registry proxies their Sidecar agents serve, the DNS answers that send Google hostnames to the Sidecar agent's :443 relay to the Google front end, and the names of the Instance CA bundle and its variables.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL