commons

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppIcon             = "apcupsd"
	PreferencesIcon     = "preferences"
	HostStatusUnknown   = "unknown"
	HostStatusOnBattery = "onbattery"
	HostStatusCharging  = "charging"
	HostStatusOnline    = "online"
)

Variables

View Source
var DebugLoggingEnabled = ("true" == os.Getenv("GAPC_DEBUG")) // "true" / "false"
View Source
var ShutdownSignals chan os.Signal

ShutdownSignals alternate panic() implementation, causes an orderly shutdown

Functions

func ChangeTimeFormat

func ChangeTimeFormat(timeString string, format string) string

ChangeTimeFormat converts APC timestamp to something more human readable time.RFC1123, time.RFC3339 are good choices returns local time version of value

func DebugLog added in v0.9.3

func DebugLog(args ...any)

func Keys

func Keys[M ~map[K]V, K comparable, V any](m M) []K

Keys returns the keys of the map m. The keys will be an indeterminate order. alternate reflect based: reflect.ValueOf(m).MapKeys()

func ShiftSlice added in v0.9.3

func ShiftSlice[K comparable](newData K, slice []K) []K

ShiftSlice drops index 0 and append newData to any type of slice

func SknLoadImageFromURI

func SknLoadImageFromURI(u fyne.URI, themed bool) fyne.CanvasObject

SknLoadImageFromURI loads an image or svg from filesystem

func SknSelectImage

func SknSelectImage(alias string) *canvas.Image

func SknSelectResource

func SknSelectResource(alias string) fyne.Resource

func SknSelectThemedImage

func SknSelectThemedImage(alias string) *canvas.Image

func SknSelectThemedInvertedImage

func SknSelectThemedInvertedImage(alias string) *canvas.Image

func SknSelectThemedResource

func SknSelectThemedResource(alias string) fyne.Resource

Types

This section is empty.

Jump to

Keyboard shortcuts

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