portapps

package module
v1.56.14 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Info       AppInfo
	Prev       AppPrev
	WinVersion win.Version

	ID   string
	Name string
	Args []string

	RootPath   string
	AppPath    string
	DataPath   string
	WorkingDir string
	Process    string
	// contains filtered or unexported fields
}

App represents an active app object

func New

func New(id string, name string) (app *App, err error)

New creates new app instance

func NewWithCfg

func NewWithCfg(id string, name string, appcfg interface{}) (app *App, err error)

NewWithCfg creates new app instance with an app config

func (*App) Close

func (app *App) Close()

Close closes the app

func (*App) Config

func (app *App) Config() *Config

Config returns app configuration

func (*App) ElectronAppPath

func (app *App) ElectronAppPath() string

ElectronAppPath returns the app electron path

func (*App) ErrorBox

func (app *App) ErrorBox(msg interface{})

ErrorBox display an error message box

func (*App) ErrorBoxLog

func (app *App) ErrorBoxLog(msg interface{})

ErrorBoxLog display an error message box nad log

func (*App) FatalBox

func (app *App) FatalBox(msg interface{})

FatalBox display an error message box and exit

func (*App) FatalBoxLog

func (app *App) FatalBoxLog(msg interface{})

FatalBoxLog display an error message box, log and exit

func (*App) InitLogger

func (app *App) InitLogger() error

InitLogger configures logger

func (*App) Launch

func (app *App) Launch(args []string)

Launch to execute the app with additional args

type AppInfo

type AppInfo struct {
	ID              string `json:"id"`
	GUID            string `json:"guid"`
	Name            string `json:"name"`
	Version         string `json:"version"`
	Release         string `json:"release"`
	Date            string `json:"date"`
	Publisher       string `json:"publisher"`
	URL             string `json:"url"`
	PortappsVersion string `json:"portapps_version"`
}

AppInfo represents portapp.json file structure

type AppPrev

type AppPrev struct {
	Info       AppInfo     `json:"info"`
	WinVersion win.Version `json:"win_version"`
	RootPath   string      `json:"root_path"`
	AppPath    string      `json:"app_path"`
	DataPath   string      `json:"data_path"`
}

AppPrev represents previous settings file structure

type Common

type Common struct {
	DisableLog bool              `yaml:"disable_log" mapstructure:"disable_log"`
	Args       []string          `yaml:"args" mapstructure:"args"`
	Env        map[string]string `yaml:"env" mapstructure:"env"`
	AppPath    string            `yaml:"app_path" mapstructure:"app_path"`
}

Common holds common configuration data

type Config

type Config struct {
	Common Common      `yaml:"common" mapstructure:"common"`
	App    interface{} `yaml:"app,omitempty" mapstructure:"app"`
}

Config holds portapp configuration details

Directories

Path Synopsis
pkg
log
Package log source from https://github.com/rs/zerolog/tree/master/log
Package log source from https://github.com/rs/zerolog/tree/master/log
utl
win

Jump to

Keyboard shortcuts

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