Documentation ¶
Index ¶
- Constants
- Variables
- func AtoInt32(text string) (int32, error)
- func BinaryLocation() (string, error)
- func CacheDir() (string, error)
- func ConfigDir() (string, error)
- func Contains(arr []string, str string) bool
- func CreateUniqueDirectory(dir string, name string, maximumAttempts int) (string, error)
- func DownloadFile(filepath string, url string) (err 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 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 LoadCacheData(fileName string, loader CacheLoader) ([]byte, error)
- func MissingOption(name string) error
- 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 RegexpSplit(text string, regexSeperator string) []string
- func ReverseStrings(a []string)
- func SortedMapKeys(m map[string]string) []string
- func StringArrayIndex(array []string, value string) int
- func StringIndexes(text string, value string) []int
- func SuggestionsFor(typedName string, values []string, suggestionsMinimumDistance int, ...) []string
- func UnTargz(tarball, target string, onlyFiles []string) error
- func Unzip(src, dest string) error
- func UrlJoin(paths ...string) string
- type CacheLoader
Constants ¶
const ( DefaultWritePermissions = 0760 MaximumNewDirectoryAttempts = 1000 )
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 ¶
func CreateUniqueDirectory ¶
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 ¶
Download a file from the given URL
func EnvironmentsDir ¶
func FileExists ¶
func FirstNotEmptyString ¶
FirstNotEmptyString returns the first non empty string or the empty string if none can be found
func GetCommandOutput ¶
GetCommandOutput evaluates the given command and returns the trimmed output
func InvalidArg ¶
func InvalidArgError ¶
func InvalidArgf ¶
func InvalidOptionf ¶
func LoadCacheData ¶
func LoadCacheData(fileName string, loader CacheLoader) ([]byte, error)
LoadCacheData loads cached data from the given cache file name and loader
func MissingOption ¶
func PickNameWithDefault ¶
func RegexpSplit ¶
RegexpSplit splits a string into an array using the regexSep as a separator
func ReverseStrings ¶
func ReverseStrings(a []string)
func SortedMapKeys ¶
SortedMapKeys returns the sorted keys of the given map
func StringArrayIndex ¶
func StringIndexes ¶
StringIndexes returns all the indices where the value occurs in the given string
func SuggestionsFor ¶
func UnTargz ¶
untargz a tarball to a target, from http://blog.ralch.com/tutorial/golang-working-with-tar-and-gzipf