Documentation ¶
Index ¶
- Variables
- func BoolStatus(b bool) string
- func BoolString(b bool) string
- func BoolYesNo(b bool) string
- func BoxSealAnonymous(base64Pubkey, msg *string) *string
- func CurrentDirBase() *string
- func CurrentPath() *string
- func DebugEnv() bool
- func DebugLog(msg ...interface{})
- func ErrCheck(e error)
- func FullPath(workpathP *string) *string
- func GitExecExist() bool
- func GitExecPath() string
- func GitRemote(workpathP *string, v bool) *[]string
- func GitRemoteExist(workpathP *string, name string) bool
- func GitRemoteRemoveAll(workpathP *string)
- func GitRoot(workpathP *string) string
- func GitRootSubmodule(workpathP *string) string
- func JsonIndentSp(baP *[]byte, endl bool) *string
- func Report(data any, title string, skipEmpty bool, singleLine bool)
- func ReportDebug(data any, title string, skipEmpty bool, singleLine bool)
- func ReportSp(data any, title string, skipEmpty bool, singleLine bool) *string
- func ReportSpDebug(data any, title string, skipEmpty bool, singleLine bool) *string
- func ReportStatus(data bool, title string, singleLine bool)
- func StrArrayPtrContain(aP *[]string, sP *string) bool
- func StrArrayPtrPrintln(saP *[]string)
- func StrArrayPtrRemoveEmpty(saP *[]string) *[]string
- func StrPtrToArrayPtr(sP *string) *[]string
- type MyCmd
- func GitInit(workpathP *string) *MyCmd
- func GitPush(workpathP *string, optionsP *[]string) *MyCmd
- func GitRemoteAdd(workpathP *string, name string, git string) *MyCmd
- func GitRemoteRemove(workpathP *string, name string) *MyCmd
- func MyCmdInit(name string, argsP *[]string, workpathP *string) *MyCmd
- func MyCmdRun(name string, argsP *[]string, workpathP *string) *MyCmd
- func MyCmdRunWg(name string, argsP *[]string, workpathP *string, title *string, ...) *MyCmd
- type ReportT
Constants ¶
This section is empty.
Variables ¶
var Debug bool = false
debug flag for helper package
Functions ¶
func BoxSealAnonymous ¶
Encrypt msg with public key using nacl box seal anonymous.
Parameter "base64Pubkey" and returning string are base64 encoded.
func FullPath ¶ added in v1.0.0
Return full path of path provided. An Empty 'workpath' will return current path. 'workpath' not modified.
func GitRemoteExist ¶
execute "git remote exit" using MyCmd
func GitRemoteRemoveAll ¶
func GitRemoteRemoveAll(workpathP *string)
execute "git remote remove" all git remote using MyCmd
func GitRoot ¶ added in v0.9.9
Get git root from current directory. Return empty string if not a git dir.
func GitRootSubmodule ¶ added in v0.9.9
Get git submodule root from `workpath`. If `workpath` is empty, current directory is used. Return empty string if not a submodule dir.
func JsonIndentSp ¶
Json indent *[]byte -> *string
func ReportSpDebug ¶ added in v0.9.8
func ReportStatus ¶
func StrArrayPtrContain ¶
Check if string array contain a string
func StrArrayPtrRemoveEmpty ¶
Remove empty lines from *[]string
func StrPtrToArrayPtr ¶ added in v1.0.0
*string -> *[]string
Types ¶
type MyCmd ¶
type MyCmd struct { ArgsP *[]string `json:"ArgsP"` // Command args Name string `json:"Name"` // Command name WorkDir string `json:"Dir"` // Command working dir CmdLn string `json:"CmdLn"` // Out: Command Line Err error `json:"Err"` // Out: run error Stdout bytes.Buffer `json:"Stdout"` // Out: Stdout Stderr bytes.Buffer `json:"Stderr"` // Out: Stderr }
go exec.Cmd wrapper
func GitRemoteAdd ¶
execute "git remote add" using MyCmd
func GitRemoteRemove ¶
execute "git remote remove" using MyCmd
func MyCmdInit ¶ added in v0.9.9
Setup a MyCmd and return pointer to it If `workpath` is empty, current directory is used.
func MyCmdRun ¶
MyCmd run func wrapper with working directory support. If `workpath` is empty, current directory is used.
type ReportT ¶
type ReportT struct { Data any `json:"Data"` // Data to be printed Title string `json:"Title"` // Title of print out ModeStatus bool `json:"ModeStatus"` // bool to "OK/Failed" SkipEmpty bool `json:"SkipEmpty"` // Return empty string if Data is empty SingleLine bool `json:"SingleLine"` // No need line after title }