Help us shape the future of Go! Take the 2026 Go Developer Survey

emulator

package
v1.223.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package emulator implements the `emulator` component kind: a stack-scoped, long-running cloud-API emulator container (Floci, MiniStack, k3s, OpenBao, …). It reuses the container component lifecycle (ComponentType "emulator") and the emulator driver/profile registry in pkg/emulator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteDown

func ExecuteDown(ctx context.Context, info *schema.ConfigAndStacksInfo) error

ExecuteDown stops and removes the emulator's container.

func ExecuteExec

func ExecuteExec(ctx context.Context, info *schema.ConfigAndStacksInfo, command []string) error

ExecuteExec runs a command in the emulator's container. Args after `--` form the command; defaults to a shell.

func ExecuteList

func ExecuteList(ctx context.Context, info *schema.ConfigAndStacksInfo) error

ExecuteList lists emulators in a clean, theme-aware table with a status dot. Unlike ExecutePs it does not require a component: it builds the manager from the container-runtime config alone and lists every emulator discovered by label (scoped to info.Stack when `--stack` is set, otherwise all stacks).

func ExecuteLogs

func ExecuteLogs(ctx context.Context, info *schema.ConfigAndStacksInfo) error

ExecuteLogs streams the emulator container's logs.

func ExecutePs

func ExecutePs(ctx context.Context, info *schema.ConfigAndStacksInfo) error

ExecutePs lists running emulators in the component's stack.

func ExecuteReset

func ExecuteReset(ctx context.Context, info *schema.ConfigAndStacksInfo, force bool) error

ExecuteReset stops and removes the emulator's container and wipes its persisted state. Unless force is set, it prompts for confirmation first.

func ExecuteUp

func ExecuteUp(ctx context.Context, info *schema.ConfigAndStacksInfo) error

ExecuteUp starts (or reuses) the emulator's long-running container.

func ExecuteUpEphemeral

func ExecuteUpEphemeral(ctx context.Context, info *schema.ConfigAndStacksInfo) error

ExecuteUpEphemeral starts the emulator without persistence for this run, overriding the component's `ephemeral:` config (mirrors the `--ephemeral` flag).

Types

type Config

type Config struct {
	// BasePath is the base directory for emulator component assets.
	BasePath string `mapstructure:"base_path"`
}

Config is the global configuration for the emulator component kind, stored under `components.emulator` in atmos.yaml and read via the Plugins map.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default global emulator component configuration.

type EmulatorComponentProvider

type EmulatorComponentProvider struct{}

EmulatorComponentProvider implements component.ComponentProvider for the emulator component kind: a stack-scoped, long-running cloud-API emulator whose lifecycle is discovered by labels derived from the canonical instance address.

func (*EmulatorComponentProvider) Execute

Execute dispatches an emulator subcommand to the matching executor.

func (*EmulatorComponentProvider) GenerateArtifacts

func (p *EmulatorComponentProvider) GenerateArtifacts(_ *component.ExecutionContext) error

GenerateArtifacts is a no-op for emulator components (no generated files).

func (*EmulatorComponentProvider) GetAvailableCommands

func (p *EmulatorComponentProvider) GetAvailableCommands() []string

GetAvailableCommands returns the lifecycle verbs supported by emulator components.

func (*EmulatorComponentProvider) GetBasePath

func (p *EmulatorComponentProvider) GetBasePath(atmosConfig *schema.AtmosConfiguration) string

GetBasePath returns the base directory path for emulator components.

func (*EmulatorComponentProvider) GetGroup

func (p *EmulatorComponentProvider) GetGroup() string

GetGroup returns the component group for categorization.

func (*EmulatorComponentProvider) GetType

func (p *EmulatorComponentProvider) GetType() string

GetType returns the component type identifier.

func (*EmulatorComponentProvider) ListComponents

func (p *EmulatorComponentProvider) ListComponents(_ context.Context, _ string, stackConfig map[string]any) ([]string, error)

ListComponents discovers all emulator components in a stack.

func (*EmulatorComponentProvider) ValidateComponent

func (p *EmulatorComponentProvider) ValidateComponent(config map[string]any) error

ValidateComponent validates emulator component configuration. A real (non-abstract) component must declare a driver.

Jump to

Keyboard shortcuts

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