util

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 29 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNotSudo

func CheckNotSudo()

CheckNotSudo -- checks if current user is sudoer and exits if they are.

func GetJSONFromClientByGet

func GetJSONFromClientByGet(config *eUtils.DriverConfig, httpClient *http.Client, headers map[string]string, address string, body io.Reader) (map[string]interface{}, int, error)

func GetJSONFromClientByPost

func GetJSONFromClientByPost(config *eUtils.DriverConfig, httpClient *http.Client, headers map[string]string, address string, body io.Reader) (map[string]interface{}, int, error)

func GetLocalVaultHost

func GetLocalVaultHost(withPort bool, vaultHostChan chan string, vaultLookupErrChan chan error, logger *log.Logger)

Unused/deprecated

func GetPluginToolConfig

func GetPluginToolConfig(config *eUtils.DriverConfig, mod *helperkv.Modifier, pluginConfig map[string]interface{}, defineService bool) (map[string]interface{}, error)

func LoadBaseTemplate

func LoadBaseTemplate(config *eUtils.DriverConfig, templateResult *extract.TemplateResultData, goMod *helperkv.Modifier, project string, service string, templatePath string) error

func OpenDirectConnection

func OpenDirectConnection(config *eUtils.DriverConfig, url string, username string, password string) (*sql.DB, error)

OpenDirectConnection opens connection to a database using various sql urls used by Spectrum.

func ResolveTokenName

func ResolveTokenName(env string) string

func SeedVaultById

func SeedVaultById(config *eUtils.DriverConfig, goMod *helperkv.Modifier, service string, address string, token string, baseTemplate *extract.TemplateResultData, tableData map[string]interface{}, indexPath string, project string) error

func UncompressZipFile added in v1.3.4

func UncompressZipFile(filePath string) (bool, []error)

Types

type ProcessFlowConfig

type ProcessFlowConfig func(pluginEnvConfig map[string]interface{}) map[string]interface{}

type ProcessFlowFunc

type ProcessFlowFunc func(pluginConfig map[string]interface{}, logger *log.Logger) error

type ProcessFlowInitConfig

type ProcessFlowInitConfig func(pluginConfig map[string]interface{}, logger *log.Logger) error

type Properties

type Properties struct {
	AuthEndpoint string
	// contains filtered or unexported fields
}

Properties stores all configuration properties for a project.

func NewProperties

func NewProperties(config *eUtils.DriverConfig, v *sys.Vault, mod *helperkv.Modifier, env string, project string, service string) (*Properties, error)

func (*Properties) GetConfigValue

func (p *Properties) GetConfigValue(service string, config string, key string) (string, bool)

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

func (*Properties) GetConfigValues

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

GetConfigValues gets an invididual configuration value for a service from the data store.

func (*Properties) GetPluginData

func (p *Properties) GetPluginData(region string, service string, config string, log *log.Logger) (map[string]interface{}, map[string]interface{})

func (*Properties) GetValue

func (p *Properties) GetValue(service string, keyPath []string, key string) (string, error)

GetValue gets an invididual configuration value for a service from the data store.

func (*Properties) WritePluginData

func (p *Properties) WritePluginData(pluginData map[string]interface{}, replacedFields map[string]interface{}, mod *helperkv.Modifier, log *log.Logger, hostRegion string, pluginName string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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