config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseModuleAttributes

func ParseModuleAttributes(
	ctx context.Context,
	mc model.ClientSet,
	attributes map[string]any,
	onlyValidated bool,
	opts RunOpts,
) (attrs map[string]any, variables model.Variables, outputs map[string]types.OutputValue, err error)

ParseModuleAttributes parse module variables and dependencies.

Types

type Configurator

type Configurator interface {
	InputLoader
	ProviderLoader
}

Configurator is the interface to construct input configs and dependency connectors for the run.

func NewConfigurator

func NewConfigurator(deployerType string) Configurator

NewConfigurator creates a new configurator with the deployer type.

func NewTerraformConfigurator

func NewTerraformConfigurator() Configurator

type InputLoader

type InputLoader interface {
	// LoadMain loads the main config file of the config options.
	LoadMain(context.Context, model.ClientSet, *Options) (types.ResourceRunConfigData, error)
	// LoadAll loads the configs files of the config options.
	LoadAll(context.Context, model.ClientSet, *Options) (map[string]types.ResourceRunConfigData, error)
}

InputLoader is the interface to construct input configs for the run.

type Options

type Options struct {
	// SecretMountPath of the deployment job.
	SecretMountPath string

	ResourceRun *model.ResourceRun
	Connectors  model.Connectors
	SubjectID   object.ID
	// Walrus Context.
	Context types.Context

	SeverULR string
	Token    string
}

Options are the options for load a run config files.

func GetConfigOptions

func GetConfigOptions(
	ctx context.Context,
	mc model.ClientSet,
	run *model.ResourceRun,
	secretMountPath string,
) (*Options, error)

GetConfigOptions sets the config loader options. It will fetch the resource run, environment, project, resource and subject.

type ProviderLoader

type ProviderLoader interface {
	// LoadProviders loads the providers of the run required,
	// Some connectors may be required to deploy the service.
	LoadProviders(model.Connectors) (map[string]types.ResourceRunConfigData, error)
}

ProviderLoader is the interface to construct dependency connectors files for the run.

type RunOpts

type RunOpts struct {
	ResourceRun *model.ResourceRun

	ResourceName string

	ProjectID     object.ID
	EnvironmentID object.ID
}

type TerraformConfigurator

type TerraformConfigurator struct {
	// contains filtered or unexported fields
}

TerraformConfigurator constructs the terraform config files for the run.

func (*TerraformConfigurator) LoadAll

func (*TerraformConfigurator) LoadMain

func (*TerraformConfigurator) LoadProviders

func (c *TerraformConfigurator) LoadProviders(
	connectors model.Connectors,
) (map[string]types.ResourceRunConfigData, error)

Jump to

Keyboard shortcuts

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