Documentation
¶
Index ¶
- Constants
- func BuildThenRun(funcPrint func(string), funcStart func(*exec.Cmd), directory string, ...) error
- func CopyFile(source string, destination string) error
- func CreateFileWithContent(name string, content string) error
- func DoesDirExist(dirPath string) (bool, error)
- func EvaluateNewPath(pta string) (dir string, filename string, path string, _ error)
- func EvaluatePath(pta string) (dir string, filename string, path string, _ error)
- func ExecCmdWithFunc(funcPrint func(string), name string, args ...string) error
- func ExecCmdWithFuncStart(funcPrint func(string), funcStart func(*exec.Cmd), name string, args ...string) error
- func GetMagicDirectory(amount int) (string, error)
- func IsPathSanitized(path string) bool
- func ModulePathToAbsolutePath(path string) string
- func PrintCurrentDirAll()
- func ScanForOpenPort(start, end uint) (uint, error)
- func ScanPort(port uint) bool
- func SnakeToCamelCase(s string, capitalizeFirst bool) string
Constants ¶
View Source
const MagicVersion = "v1.0.0-rc9"
The current version of Magic to make sure the CLI and generated modules are always compatible
Variables ¶
This section is empty.
Functions ¶
func BuildThenRun ¶
func BuildThenRun(funcPrint func(string), funcStart func(*exec.Cmd), directory string, args ...string) error
Build and then run a go program.
func CreateFileWithContent ¶
Create a new file with content.
func DoesDirExist ¶
Check if a directory exists (argument can also just be a file)
func EvaluateNewPath ¶
func EvaluatePath ¶
func ExecCmdWithFunc ¶
func ExecCmdWithFuncStart ¶
func GetMagicDirectory ¶
Get the magic directory (as an absolute path)
func IsPathSanitized ¶
func ModulePathToAbsolutePath ¶
Convert a path from the go.mod file to an absolute path.
For relative paths to be properly parsed you need to be in the correct directory.
func PrintCurrentDirAll ¶
func PrintCurrentDirAll()
Print all files in the current directory (useful for debugging)
func ScanForOpenPort ¶
Scan a range of ports for an open port
func SnakeToCamelCase ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.