Documentation ¶
Index ¶
- func CheckGO() bool
- func Chmod(path string, perm os.FileMode) error
- func Create(path string) (*os.File, error)
- func CreateWrite(path, data string) error
- func Download(destination, url string)
- func Exec(dir, name string, arg ...string) error
- func ExecOutput(dir, name string, arg ...string) (string, error)
- func Exists(path string) bool
- func ExistsMakeDir(path string) error
- func Filename(path string) string
- func GOSetup()
- func GetDirSize(path string) (int64, error)
- func IsEmptyDir(path string, dirEntry os.DirEntry) bool
- func MkdirAll(path string) error
- func Open(path string) (*os.File, error)
- func PullContainers(target string) error
- func Remove(path string) error
- func RemoveAll(path string) error
- func StringifyArray(node *syntax.Assign) []string
- func StringifyAssign(node *syntax.Assign) string
- func StringifyFuncDecl(node *syntax.FuncDecl) string
- func Unarchive(archiveReader io.Reader, destination string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckGO ¶
func CheckGO() bool
CheckGO checks if the GO executable is already installed.
It does not take any parameters. It returns a boolean value indicating whether the GO executable is already installed.
func Chmod ¶
Chmod changes the file mode of the specified path.
It takes a string parameter `path` which represents the path of the file whose mode needs to be changed. It also takes an `os.FileMode` parameter `perm` which represents the new file mode to be set.
The function returns an error if there was an issue changing the file mode. If the file mode was successfully changed, it returns nil.
func Create ¶
Create creates a new file at the specified path.
It takes a string parameter `path` which represents the path of the file to be created. The function returns a pointer to an `os.File` and an error.
func CreateWrite ¶
CreateWrite writes the given data to the file specified by the path.
It takes two parameters: - path: a string representing the path of the file. - data: a string representing the data to be written to the file.
It returns an error if there was a problem creating or writing to the file.
func Download ¶
func Download(destination, url string)
Download downloads a file from the given URL and saves it to the specified destination.
Parameters: - destination: the path where the downloaded file will be saved. - url: the URL of the file to download.
func Exec ¶
Exec executes a command in the specified directory.
It takes the following parameters: - dir: the directory in which the command will be executed. - name: the name of the command to be executed. - arg: optional arguments to be passed to the command.
It returns an error if the command execution fails.
func ExecOutput ¶
ExecOutput executes a command with the given arguments and returns its output as a string.
It takes the following parameters: - dir: the directory in which the command should be executed. - name: the name of the command to be executed. - arg: a variadic parameter representing the arguments to be passed to the command.
It returns a string representing the output of the command and an error if any occurred.
func Exists ¶
Exists checks if a file or directory exists at the given path.
path: the path to the file or directory. bool: returns true if the file or directory exists, false otherwise.
func ExistsMakeDir ¶
ExistsMakeDir checks if a directory exists at the given path and creates it if it doesn't.
path: the path to the directory. error: returns an error if the directory cannot be created or accessed.
func Filename ¶
Filename returns the filename from a given path.
It takes a string parameter `path` which represents the path of the file. It returns a string which is the filename extracted from the path.
func GOSetup ¶
func GOSetup()
GOSetup sets up the Go environment.
It checks if Go is installed and if not, it downloads and installs it. The function takes no parameters and does not return anything.
func GetDirSize ¶
GetDirSize calculates the size of a directory in kilobytes.
It takes a path as a parameter and returns the size of the directory in kilobytes and an error if any.
func IsEmptyDir ¶
IsEmptyDir checks if a directory is empty.
It takes in two parameters: path, a string representing the directory path, and dirEntry, an os.DirEntry representing the directory entry. It returns a boolean value indicating whether the directory is empty or not.
func MkdirAll ¶
MkdirAll creates a directory and all its parent directories.
It takes a string parameter `path` which represents the path of the directory to be created. The function returns an error if any error occurs during the directory creation process.
func Open ¶
Open opens a file at the specified path and returns a pointer to the file and an error.
The path parameter is a string representing the file path to be opened. The function returns a pointer to an os.File and an error.
func PullContainers ¶
PullContainers pulls the specified container image.
target: the name of the container image to pull. error: returns an error if the container image cannot be pulled.
func Remove ¶
Remove deletes a file or directory at the specified path.
path: the path of the file or directory to be removed. Returns an error if the removal fails.
func RemoveAll ¶
RemoveAll removes a file or directory and any children it contains.
path: the path of the file or directory to be removed. error: an error if the removal fails.
func StringifyArray ¶
StringifyArray generates a string representation of an array in the given syntax.
node: A pointer to the syntax.Assign node representing the array. []string: An array of strings representing the stringified elements of the array.
func StringifyAssign ¶
StringifyAssign returns a string representation of the given *syntax.Assign node.
It takes a pointer to a *syntax.Assign node as its parameter. It returns a string.
func StringifyFuncDecl ¶
StringifyFuncDecl converts a syntax.FuncDecl node to a string representation.
It takes a pointer to a syntax.FuncDecl node as a parameter and returns a string.
Types ¶
This section is empty.