Documentation ¶
Index ¶
- func AppendSearchHostMaps(searchhostmaps []map[string]string, hostmap map[string]string) []map[string]string
- func ArgFilterToMap(argfilter string) (map[string]string, error)
- func ByteToHosts(bytes []byte) ([]cli.Host, error)
- func CheckAddress(address string) (string, error)
- func CheckArrayContainsSubstr(elements []string, substr string) bool
- func CheckPassword(password string) (string, error)
- func CheckPortRange(port string) (int32, error)
- func CheckPublicKey(key string) (string, error)
- func CheckUsername(username string) (string, error)
- func Clear()
- func Cmd(name string, arg ...string)
- func CreateDataPathJsonFile(addhosts ...cli.Host) error
- func CurrentUser() (string, error)
- func CurrentUserHome() (string, error)
- func DirectArrayToMap(elements []string) (map[string]string, error)
- func DirectStringToMap(argString string) (map[string]string, error)
- func ExitPrintln(printText any)
- func ExportDataPathFile(output string, outhosts ...map[string]string) error
- func GetDataPathRootHome() (string, error)
- func GetEnv(key, fallback string) string
- func GetKushJson() (string, error)
- func HostEquals(source cli.Host, target cli.Host) bool
- func HostMapsByValueSpace(searchhostmaps []map[string]string, columns []string) map[string]int
- func HostMapsFilter(filtermap map[string]string, diskhosts []cli.Host) ([]map[string]string, error)
- func HostMapsReturnColumns(searchhostmaps []map[string]string, columns ...string) ([]map[string]string, error)
- func HostMapsSort(searchhostmaps []map[string]string, sortfield string) ([]map[string]string, error)
- func HostToMap(host cli.Host) (map[string]string, error)
- func ImportDataPathFile(inputbytes []byte, output string) error
- func InArray(target string, arrays []string) bool
- func ManyIsEmpty(elements ...string) error
- func ManyIsNotEmpty(elements ...string) error
- func MapValueToString(arrayMaps map[string]string, sep string) string
- func PasswordWarning()
- func ReadFileToBytes(file string) ([]byte, error)
- func Remove[T any](slice []T, s int) []T
- func RemoveDataPathJsonFile(delhosts ...cli.Host) error
- func RenderTable(searchhostmaps []map[string]string, columns ...string)
- func RenderTableHead(valuespaces map[string]int, columns ...string) (map[string]int, string)
- func RenderTableRow(searchhostmaps []map[string]string, headspaces map[string]int, ...) string
- func SearchHostToTerminal(searchhostmap map[string]string) (*cli.Terminal, error)
- func StringArrayToMap(elements []string) (map[string]string, error)
- func StringArrayToString(elements []string) string
- func StringToMap(argString string) (map[string]string, error)
- func UpdateDataPathJsonFile(updatehosts []cli.Host) error
- func UpperCaseFirstLetter(word string) (string, error)
- func WriteFileToBytes(file string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendSearchHostMaps ¶
func AppendSearchHostMaps(searchhostmaps []map[string]string, hostmap map[string]string) []map[string]string
AppendSearchHostMaps append not exist elements
func ArgFilterToMap ¶
ArgFilterToMap arguments filter to map[string]string
func ByteToHosts ¶
ByteToHosts parse byte to host
func CheckAddress ¶
CheckAddress validata ssh address
func CheckArrayContainsSubstr ¶
CheckArrayContainsSubstr
func CheckPassword ¶
CheckPassword validata ssh password
func CheckPortRange ¶
CheckPortRange validata ssh port
func CheckPublicKey ¶
CheckPublicKey validata ssh publicKey
func CheckUsername ¶
CheckUsername validata ssh username
func CreateDataPathJsonFile ¶
CreateDataPathJsonFile create `$KUSH_HOME/.kush/.kush.json` by host
func DirectArrayToMap ¶
DirectArrayToMap
func DirectStringToMap ¶
DirectStringToMap
func ExportDataPathFile ¶
ExportDataPathFile export host to file stream
func GetDataPathRootHome ¶
GetDataPathRootHome get current user home path or $KUSH_HOME value to assign data path home
func HostEquals ¶
HostEquals compare two hosts for equality
func HostMapsByValueSpace ¶
HostMapsByValueSpace calculate the maximum length of the value of the specified key in the set
func HostMapsFilter ¶
HostMapsFilter filter host map collections
func HostMapsReturnColumns ¶
func HostMapsReturnColumns(searchhostmaps []map[string]string, columns ...string) ([]map[string]string, error)
HostMapsReturnColumns search collections show required columns
func HostMapsSort ¶
func HostMapsSort(searchhostmaps []map[string]string, sortfield string) ([]map[string]string, error)
HostMapsSort sort host map collections
func ImportDataPathFile ¶
func ManyIsEmpty ¶
ManyIsEmpty multi element is empty check
func ManyIsNotEmpty ¶
ManyIsNotEmpty multi element is not empty check
func MapValueToString ¶
MapValueToString the map value is converted into a string and join using sep
map[string]string { "key1":"value1", "key2":"value2" } => return "value1,value2"
func PasswordWarning ¶
func PasswordWarning()
func ReadFileToBytes ¶
ReadFileToByte parse file to bytes
func RemoveDataPathJsonFile ¶
RemoveDataPathJsonFile remove `$KUSH_HOME/.kush/.kush.json` by host
func RenderTable ¶
RenderTable render the table
func RenderTableHead ¶
RenderTableHead render the table header and return the size of each column in the header
func RenderTableRow ¶
func RenderTableRow(searchhostmaps []map[string]string, headspaces map[string]int, columns ...string) string
RenderTableRow render the table row
func SearchHostToTerminal ¶
SearchHostToTerminal search host to terminal struct
func StringArrayToMap ¶
StringArrayToMap convert array to map type
func StringArrayToString ¶
StringArrayToString arrry to string eg:[A B C] =>A,B,C
func StringToMap ¶
StringToMap convert string to map type
func UpdateDataPathJsonFile ¶
UpdateDataPathJsonFile update `$KUSH_HOME/.kush/.kush.json` by host
func UpperCaseFirstLetter ¶
UpperCaseFirstLetter return after convert word first letter to upper case
eg: word->Word , WORD->Word
func WriteFileToBytes ¶
WriteFileToBytes bytes to file
Types ¶
This section is empty.