cloud

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 1 Imported by: 0

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",
		},
	},
}

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 (value is a printf template receiving host:port)

}

Emulator holds the container configuration for a cloud service emulator.

func (Emulator) EnvVarValues

func (e Emulator) EnvVarValues(hostPort string) map[string]string

EnvVarValues returns the resolved env var map for a given host:port string.

Jump to

Keyboard shortcuts

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