system

package
v0.0.0-...-8083d74 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserPath   = os.Getenv("USERPROFILE")
	DataPath   = ".\\data\\"
	AssetsPath = ".\\assets\\"
)

Common local system paths (for data storage purposes).

Functions

func BasePath

func BasePath(path string) string

`BasePath` derives the file base from the path and removes any whitespace from it.

"C:/Path/example file.exe" -> "examplefile.exe".

func CleanPath

func CleanPath(filePath string) string

func CopyFileToDirectory

func CopyFileToDirectory(pathSourceFile string, pathDestFile string) bool

func ExitGracefully

func ExitGracefully(callOnExit func())

`ExitGracefully` will execute the supplied function before exiting the program.

func FileExists

func FileExists(filePath string) bool

func GetFileContent

func GetFileContent(filePath string) ([]byte, error)

`GetFileContent` reads the passed filepaths content and returns it as an array of bytes.

func Win32MessageBox

func Win32MessageBox(hWindow uintptr, caption, title string, flags uintptr) int

`Win32MessageBox` calls the Win32 API MessageBoxW function. This is used for previewing the MessageBox that will be sent to the client on the server side.

Types

type File

type File struct {
	Name string
	Path string
}

`File` represents the attributes of a file on the host machine.

func GetFiles

func GetFiles(folder string) (files []File)

func (*File) Move

func (file *File) Move(destination string) bool

func (*File) WriteJson

func (file *File) WriteJson(data interface{}) bool

func (*File) WriteString

func (file *File) WriteString(data string) bool

Jump to

Keyboard shortcuts

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