utils

package
v1.0.18-0...-26f8a7e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnexpandedMin     = Size{Width: 660, Height: 350}
	UnexpandedMax     = Size{Width: 0, Height: 0}
	UnexpandedDefault = Size{Width: 950, Height: 950}
	ExpandedMin       = Size{Width: 720, Height: 350}
	ExpandedMax       = Size{Width: 0, Height: 0}
	ExpandedDefault   = Size{Width: 1300, Height: 950}
)

Functions

func AddFileToZip

func AddFileToZip(writer *zip.Writer, path string, zipPath string) error

func CopyRecursive

func CopyRecursive(from, to string) error

func EnsureDirExists

func EnsureDirExists(path string) error

func ExtractZip

func ExtractZip(zipPath string, dst string) error

func GetDisplayBounds

func GetDisplayBounds() []image.Rectangle

func GetDisplayBoundsAt

func GetDisplayBoundsAt(x, y int) image.Rectangle

func IsIn

func IsIn(dir, path string) bool

func JSONMarshal

func JSONMarshal(v any, indentSize int) ([]byte, error)

func MoveRecursive

func MoveRecursive(from, to string) (bool, error)

func RedactPath

func RedactPath(path string) string

func Restart

func Restart() error

Types

type EventDispatcher

type EventDispatcher[D any] struct {
	// contains filtered or unexported fields
}

func (*EventDispatcher[D]) Dispatch

func (ed *EventDispatcher[D]) Dispatch(data D)

func (*EventDispatcher[D]) On

func (ed *EventDispatcher[D]) On(f func(D)) func()

func (*EventDispatcher[D]) Once

func (ed *EventDispatcher[D]) Once(f func(D))

type Position

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}

type Progress

type Progress struct {
	Current int64 `json:"current"`
	Total   int64 `json:"total"`
}

type Size

type Size struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

Jump to

Keyboard shortcuts

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