utils

package
v1.24.3 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfiginatorOsPathSeparator string = string(os.PathSeparator)

Functions

func ConfigTemplate

func ConfigTemplate(driverConfig *config.DriverConfig,
	modifier *helperkv.Modifier,
	emptyFilePath string,
	secretMode bool,
	project string,
	service string,
	cert bool,
	zc bool) (string, map[int]string, bool, error)

ConfigTemplate takes a modifier object, a file path where the template is located, the target path, and two maps of data to populate the template with. It configures the template and writes it to the specified file path.

func ConfigTemplateRaw

func ConfigTemplateRaw(driverConfig *config.DriverConfig, mod *helperkv.Modifier, emptyFilePath string, configuredFilePath string, secretMode bool, project string, service string, cert bool, zc bool, exitOnFailure bool) ([]byte, error)

ConfigTemplateRaw - gets a raw unpopulated template.

func FilterPaths

func FilterPaths(templatePaths []string, endPaths []string, fileFilter []string, prefix bool) ([]string, []string)

FilterPaths -- filters based on provided fileFilter

func GenerateConfigsFromVault

func GenerateConfigsFromVault(ctx config.ProcessContext, configCtx *config.ConfigContext, driverConfig *config.DriverConfig) (interface{}, error)

GenerateConfigsFromVault configures the templates in trc_templates and writes them to trcconfig

func GetPathsFromProject

func GetPathsFromProject(config *core.CoreConfig, mod *helperkv.Modifier, projects []string, services []string) ([]string, error)

func GetTemplate

func GetTemplate(driverConfig *config.DriverConfig, modifier *helperkv.Modifier, templatePath string) (string, error)

GetTemplate makes a request to the vault for the template found in <project>/<service>/<file>/template-file Returns the template data in base64 and the template's extension. Returns any errors generated by vault

func PopulateTemplate

func PopulateTemplate(driverConfig *config.DriverConfig,
	emptyTemplate string,
	modifier *helperkv.Modifier,
	secretMode bool,
	project string,
	service string,
	filename string,
	cert bool) (string, map[int]string, error)

PopulateTemplate takes an empty template and a modifier. It populates the template and returns it in a string.

Types

type ConfigDataStore

type ConfigDataStore struct {
	Regions []string
	// contains filtered or unexported fields
}

ConfigDataStore stores the data needed to configure the specified template files

func (*ConfigDataStore) GetConfigValue

func (cds *ConfigDataStore) GetConfigValue(service string, config string, key string) (string, bool)

GetConfigValue gets an individual configuration value for a service from the data store.

func (*ConfigDataStore) GetConfigValues

func (cds *ConfigDataStore) GetConfigValues(service string, config string) (map[string]interface{}, bool)

GetConfigValues gets a set of configuration values for a service from the data store.

func (*ConfigDataStore) GetValue

func (cds *ConfigDataStore) GetValue(service string, keyPath []string, key string) (string, error)

GetValue Provides data from the vault

func (*ConfigDataStore) Init

func (cds *ConfigDataStore) Init(config *core.CoreConfig,
	mod *helperkv.Modifier,
	secretMode bool,
	useDirs bool,
	project string,
	commonPaths []string,
	servicesWanted ...string) error

func (*ConfigDataStore) InitTemplateVersionData

func (cds *ConfigDataStore) InitTemplateVersionData(config *core.CoreConfig, mod *helperkv.Modifier, useDirs bool, project string, file string, servicesWanted ...string) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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