config

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

func ConfigFilePath

func ConfigFilePath() (string, error)

func DisableUpdatePrompt added in v0.5.2

func DisableUpdatePrompt() error

func Init

func Init() error

func InitFromPath added in v0.3.1

func InitFromPath(path string) error

func Set added in v0.5.2

func Set(key string, value any) error

Types

type Config

type Config struct {
	Containers   []ContainerConfig            `mapstructure:"containers"`
	Env          map[string]map[string]string `mapstructure:"env"`
	UpdatePrompt bool                         `mapstructure:"update_prompt"`
}

func Get

func Get() (*Config, error)

type ContainerConfig

type ContainerConfig struct {
	Type   EmulatorType `mapstructure:"type"`
	Tag    string       `mapstructure:"tag"`
	Port   string       `mapstructure:"port"`
	Volume string       `mapstructure:"volume"`
	// Env is a list of named environment references defined in the top-level [env.*] config sections.
	Env []string `mapstructure:"env"`
}

func (*ContainerConfig) ContainerPort added in v0.5.0

func (c *ContainerConfig) ContainerPort() (string, error)

func (*ContainerConfig) DisplayName added in v0.2.0

func (c *ContainerConfig) DisplayName() string

func (*ContainerConfig) HealthPath

func (c *ContainerConfig) HealthPath() (string, error)

func (*ContainerConfig) Image

func (c *ContainerConfig) Image() (string, error)

func (*ContainerConfig) Name

func (c *ContainerConfig) Name() string

Name returns the container name: "localstack-{type}" or "localstack-{type}-{tag}" if tag != latest

func (*ContainerConfig) ProductName

func (c *ContainerConfig) ProductName() (string, error)

func (*ContainerConfig) ResolvedEnv added in v0.3.1

func (c *ContainerConfig) ResolvedEnv(namedEnvs map[string]map[string]string) ([]string, error)

ResolvedEnv resolves the container's named environment references into KEY=value pairs. namedEnvs is the top-level [env.*] map from Config.

func (*ContainerConfig) Validate added in v0.5.1

func (c *ContainerConfig) Validate() error

func (*ContainerConfig) VolumeDir added in v0.5.2

func (c *ContainerConfig) VolumeDir() (string, error)

VolumeDir returns the host directory to mount into the container for persistence/caching. If Volume is set in the config, it is returned as-is. Otherwise, a default is computed from os.UserCacheDir()/lstk/volume/<container-name>.

type EmulatorType

type EmulatorType string
const (
	EmulatorAWS       EmulatorType = "aws"
	EmulatorSnowflake EmulatorType = "snowflake"
	EmulatorAzure     EmulatorType = "azure"
)

Jump to

Keyboard shortcuts

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