utils

package
v0.0.0-...-b87ce86 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddExtraLine

func AddExtraLine(err error, extraLine string) error

func BreakAwayFromParent

func BreakAwayFromParent(cmd *exec.Cmd)

func CallLibrary

func CallLibrary(path string, funcName string, arg string) (err error)

func CreateDesktopShortcut

func CreateDesktopShortcut(src, title, description, iconSrc string, arguments ...string) error

func CreateProductWorkDir

func CreateProductWorkDir(productWorkDir string) error

func CreateStartMenuShortcut

func CreateStartMenuShortcut(src, folder, title, description, iconSrc string, arguments ...string) error

func HideJavaWindowIfNeeded

func HideJavaWindowIfNeeded(cmd *exec.Cmd)

func HideWindow

func HideWindow(cmd *exec.Cmd)

func InstallApp

func InstallApp(app *AppInfo) error

func LoadFont

func LoadFont(fontFace string, size int, scaling float64) (font.Face, error)

func LoadIconAndSetForWindow

func LoadIconAndSetForWindow(windowTitle string) error

func LoadPngImage

func LoadPngImage(reader io.Reader) (rgbaImage *image.RGBA, err error)

func OpenOrCreateProductLogFile

func OpenOrCreateProductLogFile(productLogFile string) (*os.File, error)

func OpenTextFile

func OpenTextFile(filename string) error

func PrettyPrint

func PrettyPrint(v interface{}) error

PrettyPrint outputs v as JSON with indentation

Example
type A struct {
	A int
	B string
}
a := A{1, "hello"}
PrettyPrint(a)
Output:

{
  "A": 1,
  "B": "hello"
}

func QuoteString

func QuoteString(s string) string

func RemoveDesktopShortcut

func RemoveDesktopShortcut(title string) error

func RemoveStartMenuFolder

func RemoveStartMenuFolder(folder string) error

func ShowFatalError

func ShowFatalError(text string)

func ShowUsage

func ShowUsage(productTitle, productVersion, text string)

func SplitEscapedString

func SplitEscapedString(s string) []string

func UninstallApp

func UninstallApp(title string) error

Types

type AppInfo

type AppInfo struct {
	Title           string
	UninstallString string
	Icon            string
	Version         string
	URL             string
	Publisher       string
}

type ErrorWithExtraLine

type ErrorWithExtraLine struct {
	// contains filtered or unexported fields
}

func (*ErrorWithExtraLine) Error

func (w *ErrorWithExtraLine) Error() string

func (*ErrorWithExtraLine) ExtraLine

func (w *ErrorWithExtraLine) ExtraLine() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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