localrun

package
v0.0.0-...-082e34f Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ask

func Ask(prompt string) string

func AskBool

func AskBool(prompt string) bool

func RunLocalDeploy

func RunLocalDeploy(ctx context.Context, templateStore deployer.TemplateStore, infraAdapter IInfra, spec Spec) error

Types

type EventLoop

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

EventLoop emulates AWS infrastructure by running all handlers in the same process. Used when running as a standalone tool, e.g. when bootstrapping a new environment.

func NewEventLoop

func NewEventLoop(awsRunner IInfra, stateStore *StateStore, specBuilder *deployer.SpecBuilder) *EventLoop

func (*EventLoop) Run

type IInfra

type IInfra interface {
	HandleMessage(ctx context.Context, msg proto.Message) (*deployer_pb.DeploymentPSMEventSpec, error)
}

type InfraAdapter

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

func NewInfraAdapter

func NewInfraAdapter(ctx context.Context, cl *awsinfra.DeployerClients) (*InfraAdapter, error)

func NewInfraAdapterFromConfig

func NewInfraAdapterFromConfig(ctx context.Context, config aws.Config) (*InfraAdapter, error)

func (*InfraAdapter) HandleMessage

func (*InfraAdapter) PollStack

func (cf *InfraAdapter) PollStack(
	ctx context.Context,
	stackName string,
) (*deployer_tpb.StackStatusChangedMessage, error)

type Spec

type Spec struct {
	Version       string
	AppConfig     *application_pb.Application
	ClusterConfig *environment_pb.Cluster
	EnvConfig     *environment_pb.Environment
	ScratchBucket string
	Flags         *deployer_pb.DeploymentFlags
	ConfirmPlan   bool
}

type StateStore

type StateStore struct {
	StoreCallback func(ctx context.Context, state *deployer_pb.DeploymentState, event *deployer_pb.DeploymentEvent) error
	// contains filtered or unexported fields
}

StateStore wires back the events to the deployer, rather than relying on an event bus and database

func NewStateStore

func NewStateStore() *StateStore

func (*StateStore) GetDeployment

func (lss *StateStore) GetDeployment(ctx context.Context, id string) (*deployer_pb.DeploymentState, error)

func (*StateStore) StoreDeploymentEvent

func (lss *StateStore) StoreDeploymentEvent(ctx context.Context, state *deployer_pb.DeploymentState, event *deployer_pb.DeploymentEvent) error

type TransitionData

type TransitionData struct {
	CausedBy    *deployer_pb.DeploymentEvent
	SideEffects []outbox.OutboxMessage
	ChainEvents []deployer_pb.DeploymentPSMEvent
}

func (*TransitionData) AsCause

func (td *TransitionData) AsCause() *psm_pb.Cause

func (*TransitionData) ChainEvent

func (td *TransitionData) ChainEvent(event deployer_pb.DeploymentPSMEvent)

func (*TransitionData) FullCause

func (td *TransitionData) FullCause() *deployer_pb.DeploymentEvent

func (*TransitionData) SideEffect

func (td *TransitionData) SideEffect(msg outbox.OutboxMessage)

Jump to

Keyboard shortcuts

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