utils

package
v0.0.0-...-46850ed Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: Apache-2.0 Imports: 21 Imported by: 28

Documentation

Index

Constants

View Source
const (
	EnvBackendLaddr  = "HYDRAPP_BACKEND_LADDR"
	EnvFrontendLaddr = "HYDRAPP_FRONTEND_LADDR"
	EnvBrowser       = "HYDRAPP_BROWSER"
	EnvType          = "HYDRAPP_TYPE"
	EnvSelfupdate    = "HYDRAPP_SELFUPDATE"
)

Variables

View Source
var (
	ErrNoBrowserOpenMethodFound = errors.New("no method to open a browser found")
)
View Source
var ErrUnknownImageType = errors.New("unknown image type")

Functions

func Capitalize

func Capitalize(msg string) string

func ConvertPNG

func ConvertPNG(
	input io.Reader,
	output io.Writer,

	imageType ImageType,

	width int,
	height int,
) error

func ForkExec

func ForkExec(path string, args []string) error

func HandleNoSupportedBrowserFound

func HandleNoSupportedBrowserFound(
	appName,

	hydrappBrowserEnv,
	knownBinaries string,
	err error,
) error

func HandlePanic

func HandlePanic(appName, msg string, err error)

func Localhostize

func Localhostize(url string) string

func PolyfillEnvironment

func PolyfillEnvironment(userHomeDir string) error

func WaitForLock

func WaitForLock(path string, handlePanic func(msg string, err error))

func WriteRenders

func WriteRenders(workdir string, renders []renderers.Renderer, overwrite, ejecting bool) error

Types

type ImageType

type ImageType int
const (
	ImageTypeICO ImageType = iota
	ImageTypeICNS
	ImageTypePNG
)

Jump to

Keyboard shortcuts

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