utils

package
v0.0.0-...-12a24cc Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Green  = &color.NRGBA{R: 0, G: 180, B: 0, A: 255}
	Blue   = &color.RGBA{0, 0, 255, 255}
	White  = &color.RGBA{255, 255, 255, 255}
	Black  = &color.RGBA{0, 0, 0, 255}
	Purple = &color.NRGBA{R: 128, G: 0, B: 128, A: 255}
	Orange = &color.NRGBA{R: 198, G: 123, B: 0, A: 255}
	Grey   = &color.Gray{Y: 123}
)

Functions

func BuildConfigForCLI

func BuildConfigForCLI(configFilename string, log log.Logger) (*viper.Viper, error)

func BuildLogger

func BuildLogger(moduleName string, debugOn bool) log.Logger

func LocateFile

func LocateFile(dFile string) string

func RemoveIndexFromSlice

func RemoveIndexFromSlice(slice interface{}, index int) interface{}

RemoveIndexFromSlice() -- No good way to handle various types of slices

since reflection does not support custom types

func SknImageByName

func SknImageByName(alias string, themed bool) *canvas.Image

func SknImageFromPath

func SknImageFromPath(path string) fyne.CanvasObject

SknImageFromPath loads a image, icon, or svg from filesystem

func SknImageResourceFromPath

func SknImageResourceFromPath(path string) fyne.Resource

SknImageResourceFromPath loads a image, icon, or svg from filesystem

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 SknSelectThemedResource

func SknSelectThemedResource(alias string) fyne.Resource

func SknThemedCanvasImageFromPath

func SknThemedCanvasImageFromPath(path string) *canvas.Image

SknThemedCanvasImageFromPath loads a image, icon, or svg from filesystem with Themeing

Types

type ApiConfig

type ApiConfig struct {
	BindAddress string
}

type Config

type Config struct {
	Title   string
	RunMode string
	Version string
	Dbc     DBConfig
	Mqc     MQTTConfig
	Api     ApiConfig
	Logger  log.Logger
}

func BuildAppConfig

func BuildAppConfig(cfg *viper.Viper, log log.Logger) Config

func BuildRuntimeConfig

func BuildRuntimeConfig(moduleName string) (Config, error)

type DBConfig

type DBConfig struct {
	DemoSource      string
	DataStorage     string
	FirmwareStorage string
	DemoNetworks    []string
}

type MQTTConfig

type MQTTConfig struct {
	ClientID          string
	BrokerIP          string
	BrokerPort        int
	UserName          string
	UserPassword      string
	DiscoveryTopic    string
	SubscriptionTopic string
	LwtTopic          string
	LwtMessage        string
}

Jump to

Keyboard shortcuts

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