mebroutines

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package mebroutines contains general routines used by various MEB helper utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChdirHomeDirectory

func ChdirHomeDirectory() bool

ChdirHomeDirectory changes current working directory to home directory

func ChdirVagrantDirectory

func ChdirVagrantDirectory() bool

ChdirVagrantDirectory changes current working directory to vagrant path (ktp)

func Close

func Close(c io.Closer)

Close gracefully handles closing of closable item. defer Close(item)

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies existing file

func CreateDir

func CreateDir(path string) error

CreateDir creates new directory

func CreateFile

func CreateFile(path string) error

CreateFile creates empty new file

func ExistsCharDevice added in v1.11.0

func ExistsCharDevice(path string) bool

ExistsCharDevice returns true if given file is a Linux device file

func ExistsDir

func ExistsDir(path string) bool

ExistsDir returns true if given path exists

func ExistsFile

func ExistsFile(path string) bool

ExistsFile returns true if given file exists

func ExistsStdin

func ExistsStdin() bool

ExistsStdin returns true if stdin is available

func ExtractDiskFreeDarwin added in v1.8.1

func ExtractDiskFreeDarwin(dfOutput string) (uint64, error)

ExtractDiskFreeDarwin extracts free disk space from a given df output

func ExtractDiskFreeLinux added in v1.8.1

func ExtractDiskFreeLinux(dfOutput string) (uint64, error)

ExtractDiskFreeLinux extracts free disk space from a given df output

func ExtractDiskFreeWindows added in v1.8.1

func ExtractDiskFreeWindows(wmiData []Win32_LogicalDisk) (uint64, error)

ExtractDiskFreeWindows extracts free disk space from a given WMI query result slice

func GetDiskFree

func GetDiskFree(path string) (uint64, error)

GetDiskFree returns available disk space

func GetHomeDirectory

func GetHomeDirectory() string

GetHomeDirectory returns home directory path

func GetMebshareDirectory

func GetMebshareDirectory() string

GetMebshareDirectory returns ktp-jako path from under home directory

func GetVagrantDirectory

func GetVagrantDirectory() string

GetVagrantDirectory returns ktp-directory path from under home directory

func GetVagrantPath added in v1.8.1

func GetVagrantPath() string

GetVagrantPath returns path for Vagrant binary

func GetVagrantdDirectory

func GetVagrantdDirectory() string

GetVagrantdDirectory returns .vagrantd-directory path from under home directory

func GetVirtualBoxHiddenDirectory

func GetVirtualBoxHiddenDirectory() string

GetVirtualBoxHiddenDirectory returns ".VirtualBox" path from under home directory

func GetVirtualBoxVMsDirectory

func GetVirtualBoxVMsDirectory() string

GetVirtualBoxVMsDirectory returns "VirtualBox VMs" path from under home directory

func IfFoundVBoxManage

func IfFoundVBoxManage() bool

IfFoundVBoxManage returns true if vboxmanage can be found in path

func IfFoundVagrant

func IfFoundVagrant() bool

IfFoundVagrant returns true if Vagrant can be found in path

func IfIntlCharsInPath

func IfIntlCharsInPath(path string) bool

IfIntlCharsInPath returns true if path contains non-ASCII characters

func OpenMebShare

func OpenMebShare()

OpenMebShare command executes command that opens file browser to meb share directory

func RemoveDir

func RemoveDir(path string) error

RemoveDir removes directory and all its contents

func RunAndGetError

func RunAndGetError(commandArgs []string) (string, error)

RunAndGetError runs command with arguments and returns error code

func RunAndGetOutput

func RunAndGetOutput(commandArgs []string) (string, error)

RunAndGetOutput runs command with arguments and returns output as a string

func RunVBoxManage

func RunVBoxManage(args []string) (string, error)

RunVBoxManage runs vboxmanage command with given arguments

func RunVagrant

func RunVagrant(args []string) error

RunVagrant executes Vagrant with given arguments

func SetMainWindow

func SetMainWindow(win *ui.Window)

SetMainWindow sets libui main window pointer used by ShowErrorMessage and ShowWarningMessage

func ShowErrorMessage

func ShowErrorMessage(message string)

ShowErrorMessage shows error message popup to user

func ShowInfoMessage

func ShowInfoMessage(message string)

ShowInfoMessage shows warning message popup to user

func ShowWarningMessage

func ShowWarningMessage(message string)

ShowWarningMessage shows warning message popup to user

Types

type Win32_LogicalDisk added in v1.8.1

type Win32_LogicalDisk struct {
	Size      uint64
	FreeSpace uint64
	DeviceID  string
}

Win32_LogicalDisk is a struct used to query Windows WMI (Windows Management Instrumentation) The struct must be named with an underscore, otherwise it is not recognised and results "Invalid class" exception.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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