Documentation
¶
Index ¶
- func AutoPager(input interface{}, linesPerPage int) *cerr.CustomError
- func Blue(sentence string) string
- func Center(input string) string
- func ChangeLog(cl string, clear bool)
- func ClearTTY()
- func DecodeString(encodedstring string, privateKey string) string
- func EncodeString(string2encode string, privateKey string) string
- func GetBoolValFromPrompt(prompt string) bool
- func GetFStype(mountpoint string) (string, *cerr.CustomError)
- func GetIntValFromPrompt(prompt string) int
- func GetPassword(prompt string, debugmode bool) string
- func GetStringSliceFromPrompt(prompt string) []string
- func GetStringValFromPrompt(prompt string) string
- func GetTerminalSize() (int, int)
- func GetValueFromPrompt(prompt string) interface{}
- func Green(sentence string) string
- func Pager(lines []string, linesPerPage int)
- func PagerFromFile(filePath string, linesPerPage int) *cerr.CustomError
- func PagerFromReader(r io.Reader, linesPerPage int) *cerr.CustomError
- func PagerFromString(text string, linesPerPage int)
- func Red(sentence string) string
- func ReverseString(s string) (result string)
- func Right(input string) string
- func SI(nombre interface{}) string
- func White(sentence string) string
- func Yellow(sentence string) string
- type RepoInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoPager ¶ added in v1.11.1
func AutoPager(input interface{}, linesPerPage int) *cerr.CustomError
AutoPager dispatches to the appropriate PagerFrom* function based on input type.
func DecodeString ¶
func EncodeString ¶
Quick functions to encode and decode strings This is based on my encryption-decryption tool : https://github.com/jeanfrancoisgratton/encdec
func GetBoolValFromPrompt ¶
func GetFStype ¶ added in v1.5.1
func GetFStype(mountpoint string) (string, *cerr.CustomError)
Check which type of filesystem the mountpoint is. Currently only supports MacOS and linux; I've broken my Windows test VM and have no time for it
func GetIntValFromPrompt ¶
func GetPassword ¶
Breaking change: if DebugMode is true, we catch the passwd in cleartext
func GetStringValFromPrompt ¶
Getting typed values from prompt
func GetValueFromPrompt ¶
func GetValueFromPrompt(prompt string) interface{}
This one is more generic in the sense that it should be used whenever We cannot know before run-time what type of value should be expected
func PagerFromFile ¶ added in v1.11.0
func PagerFromFile(filePath string, linesPerPage int) *cerr.CustomError
PagerFromFile reads a file and pages its content.
func PagerFromReader ¶ added in v1.11.0
func PagerFromReader(r io.Reader, linesPerPage int) *cerr.CustomError
PagerFromReader reads from an io.Reader and pages its content.
func PagerFromString ¶ added in v1.11.0
PagerFromString splits a full string into lines, then pages it.
func ReverseString ¶
This function takes a string and returns its reverse Thus, "12345" becomes "54321"
func SI ¶
func SI(nombre interface{}) string
This function was originally written in 1993, in C, by my friend Jean-François Gauthier (jief@brebis.dyndns.org) I've ported it in C# in 2011. It still loosely based on J.F.Gauthier's version, somehow; credit is given where credit is due This function transforms a multi-digit number in International Notation; 1234567 thus becomes 1,234,567
Types ¶
type RepoInfo ¶ added in v1.10.0
type RepoInfo struct { Scheme string // e.g., https, ssh ("" if unknown) Host string // e.g., git.example.com Port string // optional (if included in the URL) TopLevelOwner string // e.g., group or username FullOwnerPath string // e.g., group/subgroup Repo string // e.g., repo (no .git) RawURL string // original input, for debug }
func ExtractRepoInfo ¶ added in v1.10.0
ExtractRepoInfo: extracts various info from the URL or SSH-style URL Returns an error if the URL is invalid or if the repo name is missing