Documentation ¶
Index ¶
- Constants
- Variables
- func AtoInt32(text string) (int32, error)
- func BasicAuth(username, password string) string
- func BinaryLocation() (string, error)
- func CacheDir() (string, error)
- func ConfigDir() (string, error)
- func Confirm(message string, defaultValue bool, help string) bool
- func Contains(arr []string, str string) bool
- func CopyDir(src string, dst string, force bool) (err error)
- func CopyDirOverwrite(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func CreateUniqueDirectory(dir string, name string, maximumAttempts int) (string, error)
- func DownloadFile(filepath string, url string) (err error)
- func DraftDir() (string, error)
- func EnvironmentsDir() (string, error)
- func FileExists(path string) (bool, error)
- func FirstNotEmptyString(values ...string) string
- func GetCommandOutput(dir string, name string, args ...string) (string, error)
- func GetLatestVersionFromGitHub(githubOwner, githubRepo string) (semver.Version, error)
- func GetMockAPIResponseFromFile(dataDir string, route MethodMap) mocker
- func HomeDir() string
- func Int32ToA(n int32) string
- func InvalidArg(value string, values []string) error
- func InvalidArgError(value string, err error) error
- func InvalidArgf(value string, message string, a ...interface{}) error
- func InvalidOption(name string, value string, values []string) error
- func InvalidOptionError(option string, value string, err error) error
- func InvalidOptionf(option string, value string, message string, a ...interface{}) error
- func IsEmpty(name string) (bool, error)
- func LoadBytes(dir, name string) ([]byte, error)
- func LoadCacheData(fileName string, loader CacheLoader) ([]byte, error)
- func MarkdownLink(text string, url string) string
- func MavenBinaryLocation() (string, error)
- func MissingOption(name string) error
- func Pad(s, pad string, width int, align int) string
- func PadCenter(s, pad string, width int) string
- func PadLeft(s, pad string, width int) string
- func PadRight(s, pad string, width int) string
- func PathWithBinary() string
- func PickName(names []string, message string) (string, error)
- func PickNameWithDefault(names []string, message string, defaultValue string) (string, error)
- func PickNames(names []string, message string) ([]string, error)
- func PickPassword(message string) (string, error)
- func PickRequiredNameWithDefault(names []string, message string, defaultValue string) (string, error)
- func PickValue(message string, defaultValue string, required bool) (string, error)
- func RegexpSplit(text string, regexSeperator string) []string
- func RenameDir(src string, dst string, force bool) (err error)
- func RenameFile(src string, dst string) (err error)
- func ReverseStrings(a []string)
- func RunCommand(dir string, name string, args ...string) error
- func SelectNames(names []string, message string, selectAll bool) ([]string, error)
- func SelectNamesWithFilter(names []string, message string, selectAll bool, filter string) ([]string, error)
- func SortedMapKeys(m map[string]string) []string
- func StringArrayIndex(array []string, value string) int
- func StringArrayToLower(values []string) []string
- func StringIndexes(text string, value string) []int
- func StringMapHasValue(m map[string]string, value string) bool
- func StringMatchesAny(text string, includes []string, excludes []string) bool
- func StringMatchesPattern(text string, pattern string) bool
- func SuggestionsFor(typedName string, values []string, suggestionsMinimumDistance int, ...) []string
- func UnTargz(tarball, target string, onlyFiles []string) error
- func Unzip(src, dest string) error
- func UrlHostNameWithoutPort(rawUri string) (string, error)
- func UrlJoin(paths ...string) string
- type CacheLoader
- type MethodMap
- type Router
Constants ¶
const ( DefaultWritePermissions = 0760 MaximumNewDirectoryAttempts = 1000 )
const ( ALIGN_LEFT = 0 ALIGN_CENTER = 1 ALIGN_RIGHT = 2 )
const (
DefaultSuggestionsMinimumDistance = 2
)
Variables ¶
var ColorError = color.New(color.FgRed).SprintFunc()
var ColorInfo = color.New(color.FgGreen).SprintFunc()
var ColorStatus = color.New(color.FgBlue).SprintFunc()
var ColorWarning = color.New(color.FgYellow).SprintFunc()
Functions ¶
func BinaryLocation ¶ added in v1.0.6
func CopyDir ¶ added in v1.0.75
credit https://gist.github.com/r0l1/92462b38df26839a3ca324697c8cba04
func CopyDirOverwrite ¶ added in v1.2.67
CopyDirOverwrite copies from the source dir to the destination dir overwriting files along the way
func CopyFile ¶ added in v1.0.75
credit https://gist.github.com/r0l1/92462b38df26839a3ca324697c8cba04
func CreateUniqueDirectory ¶ added in v1.0.2
CreateUniqueDirectory creates a new directory but if the combination of dir and name exists then append a number until a unique name is found
func DownloadFile ¶ added in v1.0.6
Download a file from the given URL
func EnvironmentsDir ¶ added in v1.0.6
func FileExists ¶
func FirstNotEmptyString ¶ added in v1.0.26
FirstNotEmptyString returns the first non empty string or the empty string if none can be found
func GetCommandOutput ¶ added in v1.0.14
GetCommandOutput evaluates the given command and returns the trimmed output
func GetLatestVersionFromGitHub ¶ added in v1.0.6
func GetMockAPIResponseFromFile ¶ added in v1.1.43
@param dataDir Location of test data json file @param router Should map a URL path to a map that maps a method to a JSON response file name. Conceptually: (url, method) -> file See pkg/gits/bitbucket_test.go for an example.
func InvalidArg ¶ added in v1.0.2
func InvalidArgError ¶ added in v1.0.2
func InvalidArgf ¶ added in v1.0.2
func InvalidOption ¶ added in v1.0.2
func InvalidOptionError ¶ added in v1.0.2
func InvalidOptionf ¶ added in v1.0.2
func LoadCacheData ¶ added in v1.0.2
func LoadCacheData(fileName string, loader CacheLoader) ([]byte, error)
LoadCacheData loads cached data from the given cache file name and loader
func MarkdownLink ¶ added in v1.1.67
MarkdownLink returns a markdown link
func MavenBinaryLocation ¶ added in v1.3.28
func MissingOption ¶ added in v1.0.54
func PathWithBinary ¶ added in v1.2.122
func PathWithBinary() string
func PickNameWithDefault ¶ added in v1.0.10
func PickPassword ¶ added in v1.1.48
func PickRequiredNameWithDefault ¶ added in v1.1.15
func RegexpSplit ¶
RegexpSplit splits a string into an array using the regexSep as a separator
func RenameFile ¶ added in v1.1.14
func ReverseStrings ¶ added in v1.0.69
func ReverseStrings(a []string)
func RunCommand ¶ added in v1.1.60
RunCommand evaluates the given command and returns the trimmed output
func SelectNames ¶ added in v1.0.119
SelectNames select which names from the list should be chosen
func SelectNamesWithFilter ¶ added in v1.2.39
func SelectNamesWithFilter(names []string, message string, selectAll bool, filter string) ([]string, error)
SelectNamesWithFilter selects from a list of names with a given filter. Optionally selecting them all
func SortedMapKeys ¶ added in v1.0.54
SortedMapKeys returns the sorted keys of the given map
func StringArrayIndex ¶ added in v1.0.2
func StringArrayToLower ¶ added in v1.1.4
StringArrayToLower returns a string slice with all the values converted to lower case
func StringIndexes ¶
StringIndexes returns all the indices where the value occurs in the given string
func StringMapHasValue ¶ added in v1.2.141
StringMapHasValue returns true if the given map contains the given value
func StringMatchesAny ¶ added in v1.2.84
StringMatches returns true if the given text matches the includes/excludes lists
func StringMatchesPattern ¶ added in v1.2.84
StringMatchesPattern returns true if the given text matches the includes/excludes lists
func SuggestionsFor ¶ added in v1.0.2
func UnTargz ¶ added in v1.0.6
untargz a tarball to a target, from http://blog.ralch.com/tutorial/golang-working-with-tar-and-gzipf
func UrlHostNameWithoutPort ¶ added in v1.2.137
UrlHostNameWithoutPort returns the host name without any port of the given URL like string