utils

package
v1.27.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 27 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BasePtr *bool
View Source
var (
	EMPTY_STRING string = ""
)
View Source
var IndexNameFilterPtr *string
View Source
var IndexValueFilterPtr *string
View Source
var IndexedPtr *string
View Source
var OnlyBasePtr = false
View Source
var ProtectedPtr *string
View Source
var RestrictedPtr *string
View Source
var ServiceFilterPtr *string
View Source
var ServiceNameFilterPtr *string
View Source
var SubPathFilter *string

Functions

func AutoAuth

func AutoAuth(driverConfig *config.DriverConfig,
	secretIDPtr *string,
	appRoleIDPtr *string,
	tokenNamePtr *string,
	tokenProvidedPtr *string,
	envPtr *string,
	addrPtr *string,
	envCtxPtr *string,
	appRoleConfigPtr *string,
	ping bool) error

AutoAuth attempts to authenticate a user.

func BoundCheck

func BoundCheck(driverConfig *config.DriverConfig, versionNumbers []int, version string)

func CheckError

func CheckError(config *core.CoreConfig, err error, exit bool)

CheckError Simplifies the error checking process

func CheckErrorNoStack

func CheckErrorNoStack(config *core.CoreConfig, err error, exit bool)

CheckErrorNoStack Simplifies the error checking process

func CheckInitFlags

func CheckInitFlags(flagset *flag.FlagSet)

func CheckWarning

func CheckWarning(config *core.CoreConfig, warning string, exit bool)

CheckWarnings Checks warnings returned from various vault relation operations

func CheckWarnings

func CheckWarnings(config *core.CoreConfig, warnings []string, exit bool)

CheckWarnings Checks warnings returned from various vault relation operations

func DiffHelper

func DiffHelper(configCtx *config.ConfigContext, config bool)

func EmptyStringRef added in v1.21.0

func EmptyStringRef() *string

func GetAcceptedTemplatePaths

func GetAcceptedTemplatePaths(driverConfig *config.DriverConfig, modCheck *helperkv.Modifier, templatePaths []string) ([]string, error)

func GetEnvBasis added in v1.11.9

func GetEnvBasis(env string) string

func GetProjectService

func GetProjectService(driverConfig *config.DriverConfig, templateFile string) (string, string, int, string)

GetProjectService - returns project, service, and path to template on filesystem. driverConfig - driver configuration templateFile - full path to template file returns project, service, templatePath

func GetProjectServices

func GetProjectServices(driverConfig *config.DriverConfig, templateFiles []string) ([]string, []string, []string)

func GetProjectVersionInfo

func GetProjectVersionInfo(driverConfig *config.DriverConfig, mod *helperkv.Modifier) map[string]map[string]interface{}

func GetProjectVersions

func GetProjectVersions(driverConfig *config.DriverConfig, versionMetadataMap map[string]map[string]interface{}) []int

func GetStringInBetween

func GetStringInBetween(str string, start string, end string) (result string)

func GetSupportedProdRegions

func GetSupportedProdRegions() []string

func GetTemplateFileName

func GetTemplateFileName(templateFile string, service string) string

func InitHeadless

func InitHeadless(headless bool)

func InitPluginLogs added in v1.23.1

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

func InitVaultMod

func InitVaultMod(driverConfig *config.DriverConfig) (*config.DriverConfig, *helperkv.Modifier, *sys.Vault, error)

Helper to easiliy intialize a vault and a mod all at once.

func InitVaultModForPlugin

func InitVaultModForPlugin(pluginConfig map[string]interface{}, currentTokenName string, logger *log.Logger) (*config.DriverConfig, *helperkv.Modifier, *sys.Vault, error)

Helper to easiliy intialize a vault and a mod all at once.

func InitVaultModForTool added in v1.23.1

func InitVaultModForTool(pluginConfig map[string]interface{}, driverConfig *config.DriverConfig) (*config.DriverConfig, *helperkv.Modifier, *sys.Vault, error)

Helper to easiliy intialize a vault and a mod all at once.

func IsWindows

func IsWindows() bool

func LineByLineDiff

func LineByLineDiff(stringA *string, stringB *string, patchData bool, colorSkip bool) string

func LogAndSafeExit

func LogAndSafeExit(config *core.CoreConfig, message string, code int) error

LogAndSafeExit -- provides isolated location of os.Exit to ensure os.Exit properly processed.

func LogError

func LogError(config *core.CoreConfig, err error, f *os.File, exit bool)

LogError Writes error to the log file and terminates if an error occurs

func LogErrorAndSafeExit

func LogErrorAndSafeExit(config *core.CoreConfig, err error, code int) error

LogErrorAndSafeExit -- provides isolated location of os.Exit to ensure os.Exit properly processed.

func LogErrorMessage

func LogErrorMessage(config *core.CoreConfig, errorMessage string, exit bool)

LogErrorObject writes errors to the passed logger object and exits

func LogErrorObject

func LogErrorObject(config *core.CoreConfig, err error, exit bool)

LogErrorObject writes errors to the passed logger object and exits

func LogInfo

func LogInfo(config *core.CoreConfig, msg string)

LogErrorObject writes errors to the passed logger object and exits

func LogMessageErrorObject

func LogMessageErrorObject(config *core.CoreConfig, errorMessage string, err error, exit bool)

LogErrorObject writes errors to the passed logger object and exits

func LogWarningMessage

func LogWarningMessage(config *core.CoreConfig, errorMessage string, exit bool)

LogErrorObject writes errors to the passed logger object and exits

func LogWarnings

func LogWarnings(config *core.CoreConfig, warnings []string, f *os.File, exit bool)

LogWarnings Writes array of warnings to the log file and terminates

func LogWarningsObject

func LogWarningsObject(config *core.CoreConfig, warnings []string, exit bool)

LogWarningsObject writes warnings to the passed logger object and exits

func LoginToLocal

func LoginToLocal() (string, error)

LoginToLocal prompts the user to enter credentials from the terminal and resolves granular local environment

func Parse

func Parse(filepath string, service string, filename string) (map[string]interface{}, error)

Parse Extracts default values as key-value pairs from template files. Before being uploaded, the service and filename will be appended so the uploaded value will be <Service>.<Filename>.<Key> Underscores in key names will be replaced with periods before being uploaded

func RefEquals added in v1.21.0

func RefEquals(src *string, dest string) bool

func RefEqualsAny added in v1.21.0

func RefEqualsAny(src *string, dest []string) bool

func RefLength added in v1.21.0

func RefLength(src *string) int

func RefMap added in v1.21.0

func RefMap(m map[string]interface{}, key string) *string

func RefString added in v1.21.0

func RefString(src *string) *string

func RemoveDuplicateValues

func RemoveDuplicateValues(intSlice []string) []string

func RemoveDuplicates

func RemoveDuplicates(versionFilter []string) []string

func SanitizeForLogging

func SanitizeForLogging(errMsg string) string

func SplitEnv

func SplitEnv(env string) []string

func VersionHelper

func VersionHelper(versionData map[string]interface{}, templateOrValues bool, valuePath string, first bool)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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