framework

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TemplateNoValue   = "<no value>"
	DefaultNamePrefix = "my"
	DefaultRegion     = "us-west-1"
)
View Source
const (
	PunchTopologyTagName = "punch-topology"

	DefaultEKSAssumeRolePolicyDocument = `` /* 131-byte string literal not displayed */
	DefaultEC2AssumeRolePolicyDocument = `` /* 131-byte string literal not displayed */
)

Variables

View Source
var DefaultTopologyHandlerManager = TopologyHandlerManager{
	// contains filtered or unexported fields
}

Functions

func GetOrElse

func GetOrElse(valueMap map[string]string, key string, defaultValue string) string

Types

type AbleToPrintUsageExample

type AbleToPrintUsageExample interface {
	PrintUsageExample(topology Topology, deploymentOutput DeploymentOutput)
}

type CommandEnvironment

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

func CreateCommandEnvironment

func CreateCommandEnvironment(valueMap map[string]string) CommandEnvironment

func (*CommandEnvironment) Get

func (t *CommandEnvironment) Get(key string) string

func (*CommandEnvironment) GetBoolOrElse

func (t *CommandEnvironment) GetBoolOrElse(key string, defaultValue bool) bool

func (*CommandEnvironment) GetOrElse

func (t *CommandEnvironment) GetOrElse(key string, defaultValue string) string

func (*CommandEnvironment) GetValueMap

func (t *CommandEnvironment) GetValueMap() map[string]string

func (*CommandEnvironment) Set

func (t *CommandEnvironment) Set(key string, value string)

func (*CommandEnvironment) ToYamlString

func (t *CommandEnvironment) ToYamlString() string

type DefaultDeploymentContext

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

func (DefaultDeploymentContext) AddStepOutput

func (d DefaultDeploymentContext) AddStepOutput(name string, output map[string]interface{})

func (DefaultDeploymentContext) GetStepOutput

func (d DefaultDeploymentContext) GetStepOutput(name string) map[string]interface{}

type Deployment

type Deployment interface {
	GetContext() DeploymentContext
	AddStep(name string, description string, run DeploymentStepFunc)
	RunSteps(topology Topology) error
	GetOutput() DeploymentOutput
}

type DeploymentContext

type DeploymentContext interface {
	AddStepOutput(name string, output map[string]interface{})
	GetStepOutput(name string) map[string]interface{}
}

func NewDefaultDeploymentContext

func NewDefaultDeploymentContext() DeploymentContext

type DeploymentImpl

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

func NewDeployment

func NewDeployment() DeploymentImpl

func (*DeploymentImpl) AddStep

func (d *DeploymentImpl) AddStep(name string, description string, run DeploymentStepFunc)

func (*DeploymentImpl) GetContext

func (d *DeploymentImpl) GetContext() DeploymentContext

func (*DeploymentImpl) GetOutput

func (d *DeploymentImpl) GetOutput() DeploymentOutput

func (*DeploymentImpl) RunSteps

func (d *DeploymentImpl) RunSteps(topology Topology) error

type DeploymentOutput

type DeploymentOutput interface {
	Steps() []string
	Output() map[string]DeploymentStepOutput
}

type DeploymentOutputImpl

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

func (*DeploymentOutputImpl) Output

func (*DeploymentOutputImpl) Steps

func (t *DeploymentOutputImpl) Steps() []string

type DeploymentStep

type DeploymentStep interface {
	Name() string
	Description() string
	Run(context DeploymentContext, topology Topology) (DeploymentStepOutput, error)
}

type DeploymentStepFunc

type DeploymentStepFunc func(context DeploymentContext, topology Topology) (DeploymentStepOutput, error)

type DeploymentStepOutput

type DeploymentStepOutput map[string]interface{}

func NewDeploymentStepOutput

func NewDeploymentStepOutput() DeploymentStepOutput

type TemplateData

type TemplateData interface {
	Env() map[string]string
	Values() map[string]interface{}
}

type TemplateDataImpl

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

func CopyTemplateData

func CopyTemplateData(from TemplateData) TemplateDataImpl

func CreateTemplateData

func CreateTemplateData(env map[string]string, values map[string]string) TemplateDataImpl

func (*TemplateDataImpl) AddEnv

func (t *TemplateDataImpl) AddEnv(key string, value string)

func (*TemplateDataImpl) AddEnvs

func (t *TemplateDataImpl) AddEnvs(values map[string]string)

func (*TemplateDataImpl) AddValue

func (t *TemplateDataImpl) AddValue(key string, value interface{})

func (*TemplateDataImpl) AddValueWithNestedKey

func (t *TemplateDataImpl) AddValueWithNestedKey(key string, value interface{})

func (*TemplateDataImpl) AddValues

func (t *TemplateDataImpl) AddValues(values map[string]interface{})

func (*TemplateDataImpl) Env

func (t *TemplateDataImpl) Env() map[string]string

func (*TemplateDataImpl) GetStringValueOrDefault

func (t *TemplateDataImpl) GetStringValueOrDefault(key string, defaultValue string) string

func (*TemplateDataImpl) NamePrefix

func (t *TemplateDataImpl) NamePrefix() string

func (*TemplateDataImpl) Values

func (t *TemplateDataImpl) Values() map[string]interface{}

type TemplateDataWithRegion

type TemplateDataWithRegion struct {
	TemplateDataImpl
}

func (*TemplateDataWithRegion) DefaultS3BucketName

func (t *TemplateDataWithRegion) DefaultS3BucketName() string

func (*TemplateDataWithRegion) DefaultVpcId

func (t *TemplateDataWithRegion) DefaultVpcId() string

func (*TemplateDataWithRegion) Region

func (t *TemplateDataWithRegion) Region() string

type Topology

type Topology interface {
	GetKind() string
	// TODO remove ToString and make password mask generic function, instead of doing password mask inside ToString
	ToString() string
}

type TopologyHandler

type TopologyHandler interface {
	Generate() (Topology, error)
	Parse(yamlContent []byte) (Topology, error)
	Resolve(topology Topology, data TemplateData) (Topology, error)
	Install(topology Topology) (DeploymentOutput, error)
	Uninstall(topology Topology) (DeploymentOutput, error)
}

type TopologyHandlerManager

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

func (TopologyHandlerManager) AddHandler

func (t TopologyHandlerManager) AddHandler(kind string, handler TopologyHandler)

func (TopologyHandlerManager) GetHandler

func (t TopologyHandlerManager) GetHandler(kind string) TopologyHandler

GetHandler returns nil on unsupported kind

type TopologyMetadata

type TopologyMetadata struct {
	Name               string            `json:"name"`
	CommandEnvironment map[string]string `json:"commandEnvironment" yaml:"commandEnvironment"`
	Notes              map[string]string `json:"notes" yaml:"notes"`
}

Jump to

Keyboard shortcuts

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