api

package
v0.0.0-...-733b0cc Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigPassphraseEnvVar  = "PULUMI_CONFIG_PASSPHRASE"
	DefaultPulumiPassphrase = "simple-container.com"
)

Variables

View Source
var (
	InitStateStoreFuncByType   = map[string]InitStateStoreFunc{}
	ProviderFuncByType         = map[string]ProvisionFunc{}
	ProvisionFuncByType        = map[string]ProvisionFunc{}
	RegistrarFuncByType        = map[string]RegistrarFunc{}
	ComputeProcessorFuncByType = map[string]ComputeProcessorFunc{}
)

Functions

func CollapseStackReference

func CollapseStackReference(stackRef string) string

func ExpandStackReference

func ExpandStackReference(parentStack string, organization string, projectName string) string

func GetParentOutput

func GetParentOutput(ref *sdk.StackReference, outName string, parentRefString string, secret bool) (string, error)

func GetValueFromStack

func GetValueFromStack[T any](ctx *sdk.Context, refName, stackName, outName string, secret bool) (T, error)

func RegisterComputeProcessor

func RegisterComputeProcessor(register map[string]ComputeProcessorFunc)

func RegisterInitStateStore

func RegisterInitStateStore(providerType string, fnc InitStateStoreFunc)

func RegisterProvider

func RegisterProvider(providerType string, fnc ProvisionFunc)

func RegisterRegistrar

func RegisterRegistrar(providerType string, fnc RegistrarFunc)

func RegisterResources

func RegisterResources(register map[string]ProvisionFunc)

func StackNameInEnv

func StackNameInEnv(stackName string, environment string) string

Types

type BasicAuth

type BasicAuth struct {
	Username string
	Password string
	Realm    string
}

type Collector

type Collector struct {
	Stack   string               `json:"stackName" yaml:"stackName"`
	Env     string               `json:"environment" yaml:"environment"`
	EnvVars []ComputeEnvVariable `json:"envVariables" yaml:"envVariables"`
	// contains filtered or unexported fields
}

func (*Collector) AddDependency

func (c *Collector) AddDependency(res sdk.Resource)

func (*Collector) AddDependencyTplExtension

func (c *Collector) AddDependencyTplExtension(depName string, resName string, values map[string]string)

func (*Collector) AddEnvVariableIfNotExist

func (c *Collector) AddEnvVariableIfNotExist(name, value, resType, resName, stackName string)

func (*Collector) AddOutput

func (c *Collector) AddOutput(ctx *sdk.Context, o sdk.Output)

func (*Collector) AddPostProcessor

func (c *Collector) AddPostProcessor(forType any, processor PostProcessor)

func (*Collector) AddPreProcessor

func (c *Collector) AddPreProcessor(forType any, processor PreProcessor)

func (*Collector) AddResourceTplExtension

func (c *Collector) AddResourceTplExtension(resName string, values map[string]string)

func (*Collector) AddSecretEnvVariableIfNotExist

func (c *Collector) AddSecretEnvVariableIfNotExist(name, value, resType, resName, stackName string)

func (*Collector) Dependencies

func (c *Collector) Dependencies() []sdk.Resource

func (*Collector) EnvVariables

func (c *Collector) EnvVariables() []ComputeEnvVariable

func (*Collector) GetPostProcessors

func (c *Collector) GetPostProcessors(forType any) ([]PostProcessor, bool)

func (*Collector) GetPreProcessors

func (c *Collector) GetPreProcessors(forType any) ([]PreProcessor, bool)

func (*Collector) Outputs

func (c *Collector) Outputs() []sdk.Output

func (*Collector) ResolvePlaceholders

func (c *Collector) ResolvePlaceholders(obj any) error

func (*Collector) RunPostProcessors

func (c *Collector) RunPostProcessors(forType any, onObject any) error

func (*Collector) RunPreProcessors

func (c *Collector) RunPreProcessors(forType any, onObject any) error

func (*Collector) SecretEnvVariables

func (c *Collector) SecretEnvVariables() []ComputeEnvVariable

type ComputeContext

type ComputeContext interface {
	SecretEnvVariables() []ComputeEnvVariable
	EnvVariables() []ComputeEnvVariable
	Dependencies() []sdk.Resource
	Outputs() []sdk.Output
	ResolvePlaceholders(obj any) error
	GetPreProcessors(forType any) ([]PreProcessor, bool)
	GetPostProcessors(forType any) ([]PostProcessor, bool)
	RunPreProcessors(forType any, onObject any) error
	RunPostProcessors(forType any, onObject any) error
}

type ComputeContextCollector

type ComputeContextCollector interface {
	SecretEnvVariables() []ComputeEnvVariable
	EnvVariables() []ComputeEnvVariable
	AddEnvVariableIfNotExist(name, value, resType, resName, stackName string)
	AddSecretEnvVariableIfNotExist(name, value, resType, resName, stackName string)
	AddDependency(resource sdk.Resource)
	Dependencies() []sdk.Resource
	AddOutput(ctx *sdk.Context, o sdk.Output)
	Outputs() []sdk.Output
	ResolvePlaceholders(obj any) error
	AddResourceTplExtension(resName string, value map[string]string)
	AddDependencyTplExtension(depName string, resName string, values map[string]string)
	GetPreProcessors(forType any) ([]PreProcessor, bool)
	AddPreProcessor(forType any, processor PreProcessor)
	GetPostProcessors(forType any) ([]PostProcessor, bool)
	AddPostProcessor(forType any, processor PostProcessor)
	RunPreProcessors(forType any, onObject any) error
	RunPostProcessors(forType any, onObject any) error
}

func NewComputeContextCollector

func NewComputeContextCollector(ctx context.Context, log logger.Logger, stackName string, environment string) ComputeContextCollector

type ComputeEnvVariable

type ComputeEnvVariable struct {
	Name         string
	Value        string
	ResourceName string
	ResourceType string
	StackName    string
	Secret       bool
}

type ComputeProcessorFunc

type ComputeProcessorFunc func(ctx *sdk.Context, stack api.Stack, input api.ResourceInput, collector ComputeContextCollector, params ProvisionParams) (*api.ResourceOutput, error)

type DependencyProvider

type DependencyProvider struct {
	Provider sdk.ProviderResource
	Config   api.Config
}

type DnsPreference

type DnsPreference struct {
	BaseZone string
}

type InitStateStoreFunc

type InitStateStoreFunc func(ctx context.Context, authCfg api.StateStorageConfig, log logger.Logger) error

type OverrideHeaderRule

type OverrideHeaderRule struct {
	Name       string
	FromHost   string
	ToHost     sdk.StringInput
	PathPrefix string

	BasicAuth     *BasicAuth
	OverridePages *OverridePagesRule
}

type OverridePagesRule

type OverridePagesRule struct {
	IndexPage    string
	NotFoundPage string
}

type ParentInfo

type ParentInfo struct {
	StackName         string
	ParentEnv         string // parent stack env
	StackEnv          string // current stack env
	ResourceEnv       string // environment where resource should be consumed
	FullReference     string
	DependsOnResource *api.StackConfigDependencyResource
	UsesResource      bool
}

type PostProcessor

type PostProcessor func(any) error

type PostProcessors

type PostProcessors map[reflect.Type][]PostProcessor

type PreProcessor

type PreProcessor func(any) error

type PreProcessors

type PreProcessors map[reflect.Type][]PreProcessor

type ProvisionFunc

type ProvisionFunc func(sdkCtx *sdk.Context, stack api.Stack, input api.ResourceInput, params ProvisionParams) (*api.ResourceOutput, error)

type ProvisionParams

type ProvisionParams struct {
	// normally required to be present
	Provider       sdk.ProviderResource
	Registrar      Registrar
	Log            logger.Logger
	ComputeContext ComputeContext
	// optionally set on per-case basis
	DependencyProviders map[string]DependencyProvider
	DnsPreference       *DnsPreference
	ParentStack         *ParentInfo
	StackDescriptor     *api.StackDescriptor
	BaseEnvVariables    map[string]string
	HelpersImage        string
	ResourceOutputs     ResourcesOutputs // outputs from dependency resources
}

type Registrar

type Registrar interface {
	MainDomain() string
	ProvisionRecords(ctx *sdk.Context, params ProvisionParams) (*api.ResourceOutput, error)
	NewRecord(ctx *sdk.Context, dnsRecord api.DnsRecord) (*api.ResourceOutput, error)
	// NewOverrideHeaderRule overrides host header from one to another (only supported on certain providers)
	NewOverrideHeaderRule(ctx *sdk.Context, stack api.Stack, rule OverrideHeaderRule) (*api.ResourceOutput, error)
}

type RegistrarFunc

type RegistrarFunc func(sdkCtx *sdk.Context, desc api.RegistrarDescriptor, params ProvisionParams) (Registrar, error)

type RegistrarWithWorkerScripts

type RegistrarWithWorkerScripts interface {
	NewWorkerScript(ctx *sdk.Context, workerName string, hostName string, script string) (*api.ResourceOutput, error)
}

type ResourcesOutputs

type ResourcesOutputs map[string]*api.ResourceOutput

Jump to

Keyboard shortcuts

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