mock

package
v1.202.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// BasePath is the filesystem path to mock components.
	BasePath string `yaml:"base_path" json:"base_path" mapstructure:"base_path"`

	// Enabled determines if the mock component is active.
	// Can be overridden at stack or component level.
	Enabled bool `yaml:"enabled" json:"enabled" mapstructure:"enabled"`

	// DryRun prevents actual execution when true.
	DryRun bool `yaml:"dry_run" json:"dry_run" mapstructure:"dry_run"`

	// Tags are labels that can be merged across inheritance levels.
	Tags []string `yaml:"tags" json:"tags" mapstructure:"tags"`

	// Metadata contains nested configuration for testing deep merging.
	Metadata map[string]interface{} `yaml:"metadata" json:"metadata" mapstructure:"metadata"`

	// Dependencies lists component dependencies for DAG testing.
	Dependencies []string `yaml:"dependencies" json:"dependencies" mapstructure:"dependencies"`
}

Config represents the configuration structure for mock components. This configuration is stored in the Components.Plugins map in atmos.yaml. It's designed to test inheritance and merging behavior across global, stack, and component configuration levels.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration for mock components.

type MockComponentProvider

type MockComponentProvider struct{}

MockComponentProvider is a proof-of-concept component type for testing the component registry pattern. It demonstrates the interface implementation without requiring external tools or cloud providers. This component type is NOT documented for end users and is intended only for development and testing purposes.

func (*MockComponentProvider) Execute

Execute runs a command for this component type.

func (*MockComponentProvider) GenerateArtifacts

func (m *MockComponentProvider) GenerateArtifacts(ctx *component.ExecutionContext) error

GenerateArtifacts creates necessary files for component execution.

func (*MockComponentProvider) GetAvailableCommands

func (m *MockComponentProvider) GetAvailableCommands() []string

GetAvailableCommands returns list of commands this component type supports.

func (*MockComponentProvider) GetBasePath

func (m *MockComponentProvider) GetBasePath(atmosConfig *schema.AtmosConfiguration) string

GetBasePath returns the base directory path for this component type.

func (*MockComponentProvider) GetGroup

func (m *MockComponentProvider) GetGroup() string

GetGroup returns the component group for categorization.

func (*MockComponentProvider) GetType

func (m *MockComponentProvider) GetType() string

GetType returns the component type identifier.

func (*MockComponentProvider) ListComponents

func (m *MockComponentProvider) ListComponents(ctx context.Context, stack string, stackConfig map[string]any) ([]string, error)

ListComponents discovers all components of this type in a stack.

func (*MockComponentProvider) ValidateComponent

func (m *MockComponentProvider) ValidateComponent(config map[string]any) error

ValidateComponent validates component configuration.

Jump to

Keyboard shortcuts

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