services

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

README

Services

Services contains all the buisness logic of the tool

Template Api

Template api contains all of the api for the external and internal usage of the templates, Example of GetDefaults is shown on examples/templates.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaults

func GetDefaults(moduleName string, modulesMap *templates.MainModuleTF) string

func GetRequired added in v0.1.0

func GetRequired(moduleName string, modulesMap *templates.MainModuleTF) string

func ModuleDataWrapper

func ModuleDataWrapper(moduleName string, moduleData templates.ModuleData) map[string]interface{}

func SimpleWrap

func SimpleWrap(moduleName string, moduleData map[string]string) map[string]interface{}

Types

type ModuleParser

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

func NewParser

func NewParser(log logger.Logger, driver drivers.Parser) *ModuleParser

func (*ModuleParser) GetModulesList

func (p *ModuleParser) GetModulesList(rootFolder string) (map[string]*types.Module, error)

type TemplateAPI added in v0.1.0

type TemplateAPI struct {
	APIFuncMap *template.FuncMap
}

func NewTemplateAPI added in v0.1.0

func NewTemplateAPI() *TemplateAPI

type TemplateHandler

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

func NewTemplateHandler

func NewTemplateHandler(log logger.Logger) *TemplateHandler

func (*TemplateHandler) GetTemplate

func (th *TemplateHandler) GetTemplate(templatePath string, isDefaultTemplate bool) (*template.Template, error)

func (*TemplateHandler) WriteTemplateToFile

func (th *TemplateHandler) WriteTemplateToFile(fileName, templatePath, destinationPath string, out interface{}, isDefaultTemplate bool) error

type Terraform

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

func NewTerraform

func NewTerraform(log logger.Logger, parser *ModuleParser, templateHandler *TemplateHandler, localsTemplatePath, objectTemplatePath, mainTemplatePath string) *Terraform

func (*Terraform) GenerateMain

func (t *Terraform) GenerateMain(modulesFilePath, destinationPath, mainTemplatePath string) error

func (*Terraform) GenerateModuleDefaultLocals

func (t *Terraform) GenerateModuleDefaultLocals(modulesFilePath, destinationPath string) error

func (*Terraform) GenerateModuleVariableObject

func (t *Terraform) GenerateModuleVariableObject(modulesFilePath, destinationPath string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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