Documentation ¶
Index ¶
- Constants
- Variables
- func CheckNormalization(original string, resourceType string)
- func Execute()
- func GetFullCmdName(cmd *cobra.Command) string
- func MakeFlagRequired(cmd *cobra.Command, flagName string)
- func WriteEmptyPropertiesFile(path string)
- type AppType
- type Configuration
- func (c *Configuration) Default()
- func (c *Configuration) DeleteFromMap(propertyName string, key string)
- func (c *Configuration) Get(propertyName string) string
- func (c *Configuration) GetList(propertyName string) []string
- func (c *Configuration) GetMap(propertyName string) map[string]string
- func (c *Configuration) HasAppType(name string) bool
- func (c *Configuration) HasDeployment(name string, appType string) bool
- func (c *Configuration) HasResource(name string, property string) bool
- func (c *Configuration) HasTarget(name string) bool
- func (c *Configuration) Load(cfgFile string)
- func (c *Configuration) Print()
- func (c *Configuration) PrintMapProperty(propertyName string)
- func (c *Configuration) Update(propertyName string, value string)
- func (c *Configuration) UpdateList(propertyName string, value string)
- func (c *Configuration) UpdateMap(propertyName string, key string, value string)
- func (c *Configuration) Write(msg string, args ...string)
- type Deployment
- type DeploymentSpecification
- type DeploymentTarget
- type Normalizer
- func (n *Normalizer) AppTypeReplace(original string) string
- func (n *Normalizer) CheckNormalizeResource(original string) (string, bool)
- func (n *Normalizer) GlobalReplace(original string) string
- func (n *Normalizer) IsNormalized(original string) bool
- func (n *Normalizer) Minify(original string) string
- func (n *Normalizer) NormalizeAndReplace(original string) string
- func (n *Normalizer) NormalizeResourceName(origResourceName string) string
- func (n *Normalizer) NormalizeResources(resources []string) []string
- type RunInfo
- type Target
Constants ¶
View Source
const ( TemplateDomain = "app-types" DefinedAppTypesPropertyName = TemplateDomain + "." + "defined" TemplatesDirPropertyName = TemplateDomain + "." + "templates-dir" DefaultTemplatesDir = ".." + files.PathSeparator + "deployment-templates" TemplateFileRegexPropertyName = TemplateDomain + "." + "templates-regex" DefaultTemplatesRegex = ".*(.yml|.yaml)" )
View Source
const ( TargetsFlagName = "target" AppTypesFlagName = "app-type" )
View Source
const ( DeployableDomain = "deployments" DefinedDeploymentsPropertyName = DeployableDomain + "." + "defined" DefaultDeployablesDir = "." + files.PathSeparator + "deployables" DeployableDirPropertyName = DeployableDomain + "." + "deployables-dir" DeploymentSpecificationFileNameFlag = "file" DeploymentSpecificationFilenamePropertyName = DeployableDomain + "." + "deployment-specification-filename" DefaultDeploymentSpecificationFilename = "deployment.yml" DeploymentNameFlagName = "name" )
CMD Flags and Forge Config Property constants
View Source
const ( ImageTagPropertyKey = "ImageTag" RegistryPropertyKey = "ContainerRegistry" ImagePropertyKey = "Image" )
Property Key Constants
View Source
const ( ForgeDescriptorGenerationPropertiesFileFileNameConfigPropertyName = "generation-properties-file-name" DefaultDescriptorGenerationPropertiesFileFileName = "values.yml" )
View Source
const ( DocsDir = "./docs" GenDocsFlagName = "generate-documentation" RevEngineerFlagName = "reverse-from-fs" ForgeMarkdownFilename = "forge.md" DocumentationErrorMessage = "Error generating documentation for `forge`!" ReadMeFileName = "README.md" )
View Source
const ( NormalizationDomain = "normalization" IllegalCharRegexPropertyName = NormalizationDomain + "." + "illegal-char-regex" DefaultIllegalCharRegexPattern = "[\\\\/_\\\\.\\\\]" )
View Source
const ( ReplacementsDomain = NormalizationDomain + "." + "replacements" GlobalWordReplacementsPropertyName = ReplacementsDomain + "." + "global" AppTypeWordReplacementsPropertyName = ReplacementsDomain + "." + "app-type" )
View Source
const ( ConfigFileFlagName = "config" HomeConfigFlagName = "home-config" )
View Source
const ( TargetDomain = "targets" DefinedTargetsPropertyName = TargetDomain + "." + "defined" TargetsDirPropertyName = TargetDomain + "." + "targets-dir" DefaultTargetsDir = "." + files.PathSeparator + "targets" )
Variables ¶
View Source
var ( Config *Configuration Run *RunInfo ResourceNormalizer *Normalizer LogLevelVerbose bool PropertyMgr = maps.NewPropertyManager() TemplateRegex *regexp.Regexp AppTypeFlagValue string )
View Source
var (
TargetsFlagValue []string
)
View Source
var (
Version string
)
Functions ¶
func CheckNormalization ¶
func GetFullCmdName ¶
func MakeFlagRequired ¶
func WriteEmptyPropertiesFile ¶
func WriteEmptyPropertiesFile(path string)
Types ¶
type AppType ¶
type AppType struct { TemplatePath string DeployablePath string Templates []*descriptorTemplate Deployables []*files.FileInfo // contains filtered or unexported fields }
func NewAppType ¶
type Configuration ¶
func NewConfiguration ¶
func NewConfiguration(writeInHomeDir bool) *Configuration
func (*Configuration) Default ¶
func (c *Configuration) Default()
func (*Configuration) DeleteFromMap ¶
func (c *Configuration) DeleteFromMap(propertyName string, key string)
func (*Configuration) Get ¶
func (c *Configuration) Get(propertyName string) string
func (*Configuration) GetList ¶
func (c *Configuration) GetList(propertyName string) []string
func (*Configuration) GetMap ¶
func (c *Configuration) GetMap(propertyName string) map[string]string
func (*Configuration) HasAppType ¶
func (c *Configuration) HasAppType(name string) bool
func (*Configuration) HasDeployment ¶
func (c *Configuration) HasDeployment(name string, appType string) bool
func (*Configuration) HasResource ¶
func (c *Configuration) HasResource(name string, property string) bool
func (*Configuration) HasTarget ¶
func (c *Configuration) HasTarget(name string) bool
func (*Configuration) Load ¶
func (c *Configuration) Load(cfgFile string)
func (*Configuration) Print ¶
func (c *Configuration) Print()
func (*Configuration) PrintMapProperty ¶
func (c *Configuration) PrintMapProperty(propertyName string)
func (*Configuration) Update ¶
func (c *Configuration) Update(propertyName string, value string)
func (*Configuration) UpdateList ¶
func (c *Configuration) UpdateList(propertyName string, value string)
func (*Configuration) UpdateMap ¶
func (c *Configuration) UpdateMap(propertyName string, key string, value string)
func (*Configuration) Write ¶
func (c *Configuration) Write(msg string, args ...string)
type Deployment ¶
type Deployment struct { // v2 Name string Type string Path string Targets []*DeploymentTarget AbsolutePath string }
Deployment something that is individually deployable and testable. E.G. - a set of kubernetes deployment descriptors for defined targets of deployment
func NewDeployment ¶
func NewDeployment(specification *DeploymentSpecification, isExisting bool) *Deployment
type DeploymentSpecification ¶
type DeploymentSpecification struct { Name string `json:"name" yaml:"name"` Type string `json:"app-type" yaml:"app-type"` Targets []string `json:"targets" yaml:"targets"` Properties maps.Properties `json:"properties" yaml:"properties"` }
func (*DeploymentSpecification) IsInConfig ¶
func (s *DeploymentSpecification) IsInConfig() bool
type DeploymentTarget ¶
type DeploymentTarget struct { Name string Path string Properties maps.Properties Deployment *Deployment }
func NewDeploymentTarget ¶
func NewDeploymentTarget(name string, path string, deployment *Deployment) *DeploymentTarget
type Normalizer ¶
type Normalizer struct {
// contains filtered or unexported fields
}
func NewNormalizer ¶
func NewNormalizer(patternExpression string) *Normalizer
func (*Normalizer) AppTypeReplace ¶
func (n *Normalizer) AppTypeReplace(original string) string
func (*Normalizer) CheckNormalizeResource ¶
func (n *Normalizer) CheckNormalizeResource(original string) (string, bool)
func (*Normalizer) GlobalReplace ¶
func (n *Normalizer) GlobalReplace(original string) string
func (*Normalizer) IsNormalized ¶
func (n *Normalizer) IsNormalized(original string) bool
func (*Normalizer) Minify ¶
func (n *Normalizer) Minify(original string) string
func (*Normalizer) NormalizeAndReplace ¶
func (n *Normalizer) NormalizeAndReplace(original string) string
func (*Normalizer) NormalizeResourceName ¶
func (n *Normalizer) NormalizeResourceName(origResourceName string) string
func (*Normalizer) NormalizeResources ¶
func (n *Normalizer) NormalizeResources(resources []string) []string
Click to show internal directories.
Click to hide internal directories.