Documentation
¶
Overview ¶
Package cloud defines supported GCP cloud service emulators and their container configurations for one-command local provisioning via devx cloud spawn.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Registry = map[string]Emulator{ "gcs": { Name: "Google Cloud Storage", Service: "gcs", Image: "fsouza/fake-gcs-server:latest", DefaultPort: 4443, InternalPort: 4443, Env: map[string]string{}, ReadyLog: "server started", EnvVars: map[string]string{ "STORAGE_EMULATOR_HOST": "http://%s", }, }, "pubsub": { Name: "Google Cloud Pub/Sub", Service: "pubsub", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk:latest", DefaultPort: 8085, InternalPort: 8085, Env: map[string]string{}, ReadyLog: "Server started", EnvVars: map[string]string{ "PUBSUB_EMULATOR_HOST": "%s", }, }, "firestore": { Name: "Google Cloud Firestore", Service: "firestore", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk:latest", DefaultPort: 8080, InternalPort: 8080, Env: map[string]string{}, ReadyLog: "Dev App Server is now running", EnvVars: map[string]string{ "FIRESTORE_EMULATOR_HOST": "%s", }, }, "s3": { Name: "Amazon S3 (MinIO)", Service: "s3", Image: "minio/minio:latest", DefaultPort: 9000, InternalPort: 9000, Env: map[string]string{ "MINIO_ROOT_USER": "minioadmin", "MINIO_ROOT_PASSWORD": "minioadmin", }, ReadyLog: "API:", EnvVars: map[string]string{ "AWS_ENDPOINT_URL_S3": "http://%s", "AWS_ENDPOINT_URL": "http://%s", "AWS_ACCESS_KEY_ID": "minioadmin", "AWS_SECRET_ACCESS_KEY": "minioadmin", "AWS_REGION": "us-east-1", }, }, }
Registry of supported GCP cloud emulators.
Functions ¶
func SupportedServices ¶
func SupportedServices() []string
SupportedServices returns a sorted list of emulator service names.
Types ¶
type Emulator ¶
type Emulator struct {
Name string // Human-readable name (e.g. "Google Cloud Storage")
Service string // Short key (e.g. "gcs")
Image string // Container image
DefaultPort int // Host-side port to bind
InternalPort int // Port inside the container
Env map[string]string // Default container environment variables
ReadyLog string // Log line indicating the emulator is ready
EnvVars map[string]string // Host-side env vars to inject. Values containing "%" are treated as printf templates receiving host:port; literal values are passed through unchanged.
}
Emulator holds the container configuration for a cloud service emulator.
func (Emulator) EnvVarValues ¶
EnvVarValues returns the resolved env var map for a given host:port string. Values containing "%" are treated as printf templates receiving hostPort; literal values (e.g. fixed credentials for an emulator) are returned as-is.
Click to show internal directories.
Click to hide internal directories.