utils

package
v0.0.0-...-1a4da24 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//Staged is the const for tracking staged files
	Staged string = "staged"
	//Tracked is the const for tracking tracked files
	Tracked string = "tracked"
	//All is the const for tracking all files
	All string = "all"
)

Variables

This section is empty.

Functions

func Contains

func Contains(haystack []string, needle string) bool

Contains Does an array/slice contain a string

func DeleteGit

func DeleteGit(ptrRepo string, path string)

DeleteGit Check if we've cloned a git repo, if so delete it

func Exists

func Exists(path string) (bool, error)

Exists Check to see if a path exists

func GetAlphaNumericValues

func GetAlphaNumericValues(input string) string

GetAlphaNumericValues returns the alphanumeric part of the input string

func GetBBProject

func GetBBProject(bbURL string) (project string)

GetBBProject Parse project name from bitbucket URL

func GetConfigDir

func GetConfigDir() (configDir string)

GetConfigDir Determine the operating system and pull the path to the go-earlybird config directory

func GetDisplayList

func GetDisplayList(levelNames []string) string

GetDisplayList Build the string to display an array in a human readable format

func GetEnabledModulesMap

func GetEnabledModulesMap(enableFlags []string, availableModules map[string]string) (enabledModules map[string]string)

GetEnabledModulesMap returns a map of module name to filename enabled by default or explicitly defined with CLI paramters

func GetGitProject

func GetGitProject(gitURL string) (project string)

GetGitProject parse project from URL

func GetGitRepo

func GetGitRepo(gitURL string) (repository string)

GetGitRepo Parse repository name from URL

func GetGitURL

func GetGitURL(ptrRepo, ptrRepoUser *string) (Password string)

GetGitURL Format GI URL and parse/prompt user password

func GetTargetType

func GetTargetType(GitStagedFlag, GitTrackedFlag bool) (targetType string)

GetTargetType returns the file scan context

func MustGetED

func MustGetED() string

MustGetED Get the executable directory or exit

func MustGetWD

func MustGetWD() string

MustGetWD Get the CWD for the default target Directory or exit

func ParseBBURL

func ParseBBURL(bbURL string) (baseurl, path, project string)

ParseBBURL Parse the base URL, Path and project name from BB URL

func PathMustExist

func PathMustExist(path string)

PathMustExist exit if path is invalid

Types

This section is empty.

Jump to

Keyboard shortcuts

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