Documentation
¶
Index ¶
- Constants
- func AddToArrayIfValueExist(arr *[]string, val string)
- func Contains(s []string, str string) bool
- func ConvertPropertiesFileAsPathToMap(path string) (map[string]string, error)
- func ConvertPropertiesFileToMap(fileInBytes []byte) (map[string]string, error)
- func FindAllPortsSubmatch(re *regexp.Regexp, text string, group int) []int
- func FindPortSubmatch(re *regexp.Regexp, text string, group int) int
- func FindPotentialPortGroup(re *regexp.Regexp, text string, group int) string
- func GenLogger(logLevel string) error
- func GetAnyApplicationFilePath(root string, propsFiles []model.ApplicationFileInfo, ctx *context.Context) string
- func GetAnyApplicationFilePathExactMatch(root string, propsFiles []model.ApplicationFileInfo) string
- func GetCachedFilePathsFromRoot(root string, ctx *context.Context) ([]string, error)
- func GetComposerJsonSchemaFromFile(path string) (schema.ComposerJson, error)
- func GetFile(filePaths *[]string, wantedFile string) string
- func GetFilePathsFromRoot(root string) ([]string, error)
- func GetFilePathsInRoot(root string) ([]string, error)
- func GetFilesByRegex(filePaths *[]string, regexFile string) []string
- func GetOrCreateLogger() logr.Logger
- func GetPackageJsonSchemaFromFile(path string) (schema.PackageJson, error)
- func GetPomFileContent(pomFilePath string) (schema.Pom, error)
- func GetPortValueFromEnvFile(root string, regex string) int
- func GetPortValuesFromEnvFile(root string, regexes []string) []int
- func GetStringValueFromEnvFile(root string, regex string) string
- func GetValidPort(port string) (int, error)
- func GetValidPorts(ports []string) []int
- func GetValidPortsFromEnvs(envs []string) []int
- func HasFile(files *[]string, wantedFile string) bool
- func IsPathOfWantedFile(path string, wantedFile string) bool
- func IsTagInComposerJsonFile(file string, tag string) bool
- func IsTagInFile(file string, tag string) (bool, error)
- func IsTagInPackageJsonFile(file string, tag string) bool
- func IsTagInPomXMLFile(pomFilePath string, tag string) (bool, error)
- func IsTagInPomXMLFileArtifactId(pomFilePath, groupdId, artifactId string) (bool, error)
- func IsValidPort(port int) bool
- func NormalizeSplit(file string) (string, string)
- func PrintNoArgsWarningMessage(command string)
- func PrintPrettifyOutput(value interface{}, err error)
- func PrintWrongLoggingLevelMessage(command string)
- func ReadAnyApplicationFile(root string, propsFiles []model.ApplicationFileInfo, ctx *context.Context) ([]byte, error)
- func ReadAnyApplicationFileExactMatch(root string, propsFiles []model.ApplicationFileInfo) ([]byte, error)
- func RedirectErrorStringToStdErrAndExit(err string)
- func RedirectErrorToStdErrAndExit(err error)
- type CLILogger
Constants ¶
const FRAMEWORK_WEIGHT = 10
const FROM_PORT = 0
const TOOL_WEIGHT = 5
const TO_PORT = 65535
Variables ¶
This section is empty.
Functions ¶
func AddToArrayIfValueExist ¶
func FindAllPortsSubmatch ¶
func FindPotentialPortGroup ¶
func GetAnyApplicationFilePath ¶
func GetAnyApplicationFilePath(root string, propsFiles []model.ApplicationFileInfo, ctx *context.Context) string
GetAnyApplicationFilePath returns the location of a file if it exists in the directory and the given file name is a substring.
func GetAnyApplicationFilePathExactMatch ¶
func GetAnyApplicationFilePathExactMatch(root string, propsFiles []model.ApplicationFileInfo) string
GetAnyApplicationFilePathExactMatch returns the location of a file if it exists in the directory and matches the given file name.
func GetComposerJsonSchemaFromFile ¶
func GetComposerJsonSchemaFromFile(path string) (schema.ComposerJson, error)
GetComposerJsonSchemaFromFile returns the composer.json found in the path.
func GetFilePathsFromRoot ¶
GetFilePathsFromRoot walks the file tree starting from root and returns a slice of all file paths found. Ignores files from .gitignore if it exists.
func GetFilePathsInRoot ¶
GetFilePathsInRoot returns a slice of all files in the root.
func GetFilesByRegex ¶
GetFilesByRegex returns a slice of file paths from filePaths if the file name matches the regex.
func GetOrCreateLogger ¶
GetOrCreateLogger: Checks if the CliLogger is already created, otherwise it creates it with errorLevel
func GetPackageJsonSchemaFromFile ¶
func GetPackageJsonSchemaFromFile(path string) (schema.PackageJson, error)
GetPackageJsonSchemaFromFile returns the package.json found in the path.
func GetPomFileContent ¶
GetPomFileContent returns the pom found in the path.
func GetPortValueFromEnvFile ¶
func GetValidPort ¶
GetValidPort checks if a string is a valid port and returns the port. Returns -1 if not a valid port.
func GetValidPorts ¶
GetValidPorts returns a slice of valid ports.
func GetValidPortsFromEnvs ¶
GetValidPortsFromEnvs returns a slice of valid ports.
func IsPathOfWantedFile ¶
IsPathOfWantedFile checks if the file is in the path.
func IsTagInComposerJsonFile ¶
IsTagInComposerJsonFile checks if the file is a composer.json and contains the tag.
func IsTagInFile ¶
IsTagInFile checks if the file contains the tag.
func IsTagInPackageJsonFile ¶
IsTagInPackageJsonFile checks if the file is a package.json and contains the tag.
func IsTagInPomXMLFile ¶
IsTagInPomXMLFile checks if a pom file contains the tag.
func IsTagInPomXMLFileArtifactId ¶
IsTagInPomXMLFileArtifactId checks if a pom file contains the artifactId.
func IsValidPort ¶
IsValidPort checks if an integer is a valid port.
func NormalizeSplit ¶
func PrintNoArgsWarningMessage ¶
func PrintNoArgsWarningMessage(command string)
func PrintPrettifyOutput ¶
func PrintPrettifyOutput(value interface{}, err error)
func PrintWrongLoggingLevelMessage ¶
func PrintWrongLoggingLevelMessage(command string)
func ReadAnyApplicationFile ¶
func ReadAnyApplicationFile(root string, propsFiles []model.ApplicationFileInfo, ctx *context.Context) ([]byte, error)
ReadAnyApplicationFile returns a byte slice of a file if it exists in the directory and the given file name is a substring.
func ReadAnyApplicationFileExactMatch ¶
func ReadAnyApplicationFileExactMatch(root string, propsFiles []model.ApplicationFileInfo) ([]byte, error)
ReadAnyApplicationFileExactMatch returns a byte slice if the exact given file exists in the directory.
func RedirectErrorStringToStdErrAndExit ¶
func RedirectErrorStringToStdErrAndExit(err string)
func RedirectErrorToStdErrAndExit ¶
func RedirectErrorToStdErrAndExit(err error)