Documentation ¶
Index ¶
- func AsJson(i interface{}) string
- func ColoredString(str string, colorAttributes ...color.Attribute) string
- func ColoredStringDirect(str string, colour *color.Color) string
- func Decolorise(str string) string
- func DifferenceInt(a, b []int) []int
- func FindStringSubmatch(str string, regexpStr string) (bool, []string)
- func GetCurrentRepoName() string
- func GetProjectRoot() string
- func IncludesInt(list []int, a int) bool
- func IncludesString(list []string, a string) bool
- func Loader() string
- func Min(x, y int) int
- func ModuloWithWrap(n, max int) int
- func MustConvertToInt(s string) int
- func NewDummyLog() *logrus.Entry
- func NextIndex(numbers []int, currentNumber int) int
- func NextIntInCycle(sl []int, current int) int
- func NormalizeLinefeeds(str string) string
- func PrevIndex(numbers []int, currentNumber int) int
- func PrevIntInCycle(sl []int, current int) int
- func RenderDisplayStrings(displayStringsArr [][]string) string
- func ResolvePlaceholderString(str string, arguments map[string]string) string
- func ResolveTemplate(templateStr string, object interface{}) (string, error)
- func Safe(f func())
- func SplitLines(multilineString string) []string
- func StringArraysOverlap(strArrA []string, strArrB []string) bool
- func TrimTrailingNewline(str string) string
- func TruncateWithEllipsis(str string, limit int) string
- func UnionInt(a, b []int) []int
- func UnixToDate(timestamp int64) string
- func UnixToTimeAgo(timestamp int64) string
- func WithPadding(str string, padding int) string
- func WrapError(err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColoredString ¶
ColoredString takes a string and a colour attribute and returns a colored string with that attribute
func ColoredStringDirect ¶
ColoredStringDirect used for aggregating a few color attributes rather than just sending a single one
func Decolorise ¶ added in v0.7.1
Decolorise strips a string of color
func DifferenceInt ¶ added in v0.10.1
DifferenceInt returns the difference of two int arrays
func FindStringSubmatch ¶ added in v0.20.1
func GetCurrentRepoName ¶
func GetCurrentRepoName() string
GetCurrentRepoName gets the repo's base name
func GetProjectRoot ¶ added in v0.1.71
func GetProjectRoot() string
GetProjectRoot returns the path to the root of the project. Only to be used in testing contexts, as with binaries it's unlikely this path will exist on the machine
func IncludesInt ¶ added in v0.10.1
IncludesInt if the list contains the Int
func IncludesString ¶ added in v0.3.1
IncludesString if the list contains the string
func Loader ¶ added in v0.2.0
func Loader() string
Loader dumps a string to be displayed as a loader
func ModuloWithWrap ¶ added in v0.11.1
used to keep a number n between 0 and max, allowing for wraparounds
func MustConvertToInt ¶ added in v0.22.0
func NewDummyLog ¶ added in v0.23.1
NewDummyLog creates a new dummy Log for testing
func NextIndex ¶ added in v0.7.1
NextIndex returns the index of the element that comes after the given number
func NextIntInCycle ¶ added in v0.15.1
NextIntInCycle returns the next int in a slice, returning to the first index if we've reached the end
func NormalizeLinefeeds ¶ added in v0.1.79
NormalizeLinefeeds - Removes all Windows and Mac style line feeds
func PrevIndex ¶ added in v0.7.1
PrevIndex returns the index that comes before the given number, cycling if we reach the end
func PrevIntInCycle ¶ added in v0.15.1
PrevIntInCycle returns the prev int in a slice, returning to the first index if we've reached the end
func RenderDisplayStrings ¶ added in v0.14.4
func ResolvePlaceholderString ¶ added in v0.2.2
ResolvePlaceholderString populates a template with values
func ResolveTemplate ¶ added in v0.23.1
func Safe ¶ added in v0.23.1
func Safe(f func())
Safe will close termbox if a panic occurs so that we don't end up in a malformed terminal state
func SplitLines ¶
SplitLines takes a multiline string and splits it on newlines currently we are also stripping \r's which may have adverse effects for windows users (but no issues have been raised yet)
func StringArraysOverlap ¶ added in v0.22.0
func TrimTrailingNewline ¶
TrimTrailingNewline - Trims the trailing newline TODO: replace with `chomp` after refactor
func TruncateWithEllipsis ¶ added in v0.15.3
TruncateWithEllipsis returns a string, truncated to a certain length, with an ellipsis
func UnixToDate ¶ added in v0.20.1
func UnixToTimeAgo ¶ added in v0.20.1
func WithPadding ¶
WithPadding pads a string as much as you want
Types ¶
This section is empty.