Documentation ¶
Index ¶
- Constants
- func CheckEmptyStringAndStop(e string)
- func CheckError(e error)
- func CheckErrorAndStop(e error)
- func Checksum(filePath string) (string, error)
- func CopyDir(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func CreateDirectory(folderPath string, mode fs.FileMode) bool
- func DeleteAllFiles(dir string) error
- func DeleteFile(filePath string) error
- func DirectoryExists(folderPath string) bool
- func FileExists(path string) bool
- func GetArgumentAt(index int) string
- func GetCommandAt(index int) string
- func GetExecutionPath() string
- func GetFlagArrayValue(flag string) []string
- func GetFlagSwitch(flag string, defaultValue bool) bool
- func GetFlagValue(flag string, defaultValue string) string
- func JoinPath(items ...string) string
- func MapFlagValue(flag string) (string, string)
- func RandomHex(size int) string
- func RandomHexWithPrefix(size int) string
- func RandomString(size int) string
- func ReadFromFile(filePath string) ([]byte, error)
- func RemoveField(obj interface{}, fields ...string) map[string]interface{}
- func ToOsPath(path string) string
- func Untar(src string, dst string) error
- func Unzip(src string, dest string) ([]string, error)
- func WriteToFile(value string, filePath string) error
- type LogicState
- type OperatingSystem
- type TestNestedStructure
- type TestStructure
Constants ¶
const ( FlagPrefix = "--" FlagValueSeparator = "=" )
const (
AlphaNumeric = "1234567890abcdefghijklmnopqrstuvwxyz"
)
Helpers Constants
Variables ¶
This section is empty.
Functions ¶
func CheckEmptyStringAndStop ¶
func CheckEmptyStringAndStop(e string)
CheckEmptyStringAndStop Checks if an error exist and stops the app
func CheckErrorAndStop ¶
func CheckErrorAndStop(e error)
CheckErrorAndStop Checks if an error exist and stops the app
func CopyDir ¶
CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.
func CreateDirectory ¶ added in v0.0.26
func DeleteAllFiles ¶
func DeleteFile ¶
func DirectoryExists ¶ added in v0.0.26
DirectoryExists Checks if a directory exists
func GetArgumentAt ¶
func GetCommandAt ¶ added in v0.0.28
func GetFlagArrayValue ¶
GetFlagArrayValue Gets a array of values of a flag from the command line arguments
func GetFlagSwitch ¶
GetFlagSwitch Gets a switch value of a flag from the command line arguments
func GetFlagValue ¶
GetFlagValue Gets a value of a flag from the command line arguments
func MapFlagValue ¶
MapFlagValue Maps Keypair values from the flag
func RandomHexWithPrefix ¶
RandomHexWithPrefix generates a random hex string
func ReadFromFile ¶
func RemoveField ¶ added in v0.0.14
func Untar ¶
Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files
func Unzip ¶
Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).
func WriteToFile ¶
Types ¶
type LogicState ¶ added in v0.0.16
type LogicState int64
const ( Unknown LogicState = iota Enabled Disabled )
func (LogicState) FromString ¶ added in v0.0.16
func (l LogicState) FromString(value string) LogicState
func (LogicState) String ¶ added in v0.0.16
func (l LogicState) String() string
type OperatingSystem ¶
type OperatingSystem int
OperatingSystem enum
const ( WindowsOs OperatingSystem = iota LinuxOs UnknownOs )
Defines the operating system Enum
func GetOperatingSystem ¶
func GetOperatingSystem() OperatingSystem
GetOperatingSystem returns the operating system
Get the operating system name and return it as an OperatingSystem constant.
Args:
None
Returns:
The operating system.
func (OperatingSystem) String ¶
func (o OperatingSystem) String() string