integration

package
v1.0.0-rc9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2025 License: Apache-2.0 Imports: 10 Imported by: 8

Documentation

Index

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 CopyFile

func CopyFile(source string, destination string) error

func CreateFileWithContent

func CreateFileWithContent(name string, content string) error

Create a new file with content.

func DoesDirExist

func DoesDirExist(dirPath string) (bool, error)

Check if a directory exists (argument can also just be a file)

func EvaluateNewPath

func EvaluateNewPath(pta string) (dir string, filename string, path string, _ error)

func EvaluatePath

func EvaluatePath(pta string) (dir string, filename string, path string, _ error)

func ExecCmdWithFunc

func ExecCmdWithFunc(funcPrint func(string), name string, args ...string) error

func ExecCmdWithFuncStart

func ExecCmdWithFuncStart(funcPrint func(string), funcStart func(*exec.Cmd), name string, args ...string) error

func GetMagicDirectory

func GetMagicDirectory(amount int) (string, error)

Get the magic directory (as an absolute path)

func IsPathSanitized

func IsPathSanitized(path string) bool

func ModulePathToAbsolutePath

func ModulePathToAbsolutePath(path string) string

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

func ScanForOpenPort(start, end uint) (uint, error)

Scan a range of ports for an open port

func ScanPort

func ScanPort(port uint) bool

Scan an individual port. Returns true when the connection succeeds.

func SnakeToCamelCase

func SnakeToCamelCase(s string, capitalizeFirst bool) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL