gg_app

package
v0.2.53 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: BSD-3-Clause Imports: 16 Imported by: 4

README

App Controller

This is the main App controller with internal state, workspace and utility methods.

Documentation

Index

Constants

View Source
const (
	EventOnStartApp = gg_.EventOnStartApp
	EventOnCloseApp = gg_.EventOnCloseApp
)

Variables

This section is empty.

Functions

func Decrypt added in v0.2.26

func Decrypt(value string) string

func Download

func Download(url string) (data []byte, err error)

func Encrypt added in v0.2.26

func Encrypt(value string) string

func MD5 added in v0.2.26

func MD5(value string) string

func MD5Wrap added in v0.2.26

func MD5Wrap(value string) string

func StatusCodeToError

func StatusCodeToError(statusCode int) (err error)

Types

type AppCtrl

type AppCtrl struct {
	// contains filtered or unexported fields
}

func Main added in v0.2.29

func Main() (ctrl *AppCtrl, err error)

func NewAppCtrl

func NewAppCtrl(mode, dirWork string) (instance *AppCtrl, err error)

func (*AppCtrl) AddPathWatchdog added in v0.2.29

func (instance *AppCtrl) AddPathWatchdog(path string, callback func())

AddPathWatchdog activate an observer over a path directory

func (*AppCtrl) AddStopOperation

func (instance *AppCtrl) AddStopOperation(name string, callback gg_stoppable.ShutdownCallback) *AppCtrl

func (*AppCtrl) Deploy

func (instance *AppCtrl) Deploy(filename string, text string, overwrite bool) (err error)

func (*AppCtrl) DeployIntoWorkspace

func (instance *AppCtrl) DeployIntoWorkspace(path string, tpl string, overwrite bool) (err error)

func (*AppCtrl) Events

func (instance *AppCtrl) Events() *gg_events.Emitter

func (*AppCtrl) Info

func (instance *AppCtrl) Info() *ApplicationInfo

func (*AppCtrl) Join

func (instance *AppCtrl) Join()

func (*AppCtrl) Logger

func (instance *AppCtrl) Logger() gg_.ILogger

func (*AppCtrl) OnStart

func (instance *AppCtrl) OnStart(f func())

func (*AppCtrl) OnStop

func (instance *AppCtrl) OnStop(f func())

func (*AppCtrl) SetAppName

func (instance *AppCtrl) SetAppName(value string)

func (*AppCtrl) SetAppSalt

func (instance *AppCtrl) SetAppSalt(value string)

func (*AppCtrl) SetAppVersion

func (instance *AppCtrl) SetAppVersion(value string)

func (*AppCtrl) SetEvents

func (instance *AppCtrl) SetEvents(value *gg_events.Emitter)

func (*AppCtrl) SetLogFilename

func (instance *AppCtrl) SetLogFilename(value string)

func (*AppCtrl) SetLogLevel

func (instance *AppCtrl) SetLogLevel(value string)

func (*AppCtrl) SetLogRotation

func (instance *AppCtrl) SetLogRotation(value bool)

func (*AppCtrl) SetLogger

func (instance *AppCtrl) SetLogger(value gg_.ILogger)

func (*AppCtrl) SetStopSleep added in v0.2.41

func (instance *AppCtrl) SetStopSleep(value time.Duration)

func (*AppCtrl) SetStopTimeout added in v0.2.41

func (instance *AppCtrl) SetStopTimeout(value time.Duration)

func (*AppCtrl) Start

func (instance *AppCtrl) Start() bool

func (*AppCtrl) State added in v0.2.25

func (instance *AppCtrl) State() *gg_observable.ObservableObj

State returns the App "observable" state.

func (*AppCtrl) Stop

func (instance *AppCtrl) Stop() bool

func (*AppCtrl) String

func (instance *AppCtrl) String() string

func (*AppCtrl) WorkspaceDir

func (instance *AppCtrl) WorkspaceDir() string

func (*AppCtrl) WorkspacePath

func (instance *AppCtrl) WorkspacePath(path string) string

type AppCtrlHelper

type AppCtrlHelper struct {
}
var App *AppCtrlHelper

func (*AppCtrlHelper) Main added in v0.2.29

func (helper *AppCtrlHelper) Main() (ctrl *AppCtrl, err error)

func (*AppCtrlHelper) New

func (helper *AppCtrlHelper) New(mode, dirWork string) (instance *AppCtrl, err error)

type ApplicationInfo

type ApplicationInfo struct {
	AppName        string                   `json:"app-name"`
	AppVersion     string                   `json:"app-version"`
	AppSalt        string                   `json:"app-salt"`
	MimeJS         string                   `json:"mime-js"`
	MimeCSS        string                   `json:"mime-css"`
	MimeHTML       string                   `json:"mime-html"`
	MimeJSON       string                   `json:"mime-json"`
	StartTime      time.Time                `json:"start-time"`
	Mode           string                   `json:"running-mode"`
	UIMode         string                   `json:"ui-mode"`
	Root           string                   `json:"root"`
	LaunchDir      string                   `json:"launch-dir"`
	SettingsFile   string                   `json:"settings-file"`
	SettingsLoaded bool                     `json:"settings-loaded"`
	ProcessPID     int                      `json:"process-pid"`
	UserHome       string                   `json:"user-home"`
	UserName       string                   `json:"user-name"`
	SysHostName    string                   `json:"sys-hostname"`
	SysKernel      string                   `json:"sys-kernel"`
	SysPlatform    string                   `json:"sys-platform"`
	SysCPUs        int                      `json:"sys-cpu"`
	SysMemoryUsage string                   `json:"sys-memoryusage"`
	Errors         []*ApplicationInfoError  `json:"errors"`
	License        *license_commons.License `json:"license"`
	LibVersions    map[string]string        `json:"lib-versions"`
}

func NewApplicationInfo

func NewApplicationInfo(dirWork string) *ApplicationInfo

func (*ApplicationInfo) AddError

func (instance *ApplicationInfo) AddError(context string, err error)

func (*ApplicationInfo) AddLibVersion added in v0.2.25

func (instance *ApplicationInfo) AddLibVersion(name, version string) *ApplicationInfo

func (*ApplicationInfo) GetLicense

func (instance *ApplicationInfo) GetLicense() *license_commons.License

func (*ApplicationInfo) PathRoot

func (instance *ApplicationInfo) PathRoot(value ...string) string

func (*ApplicationInfo) PathSettings

func (instance *ApplicationInfo) PathSettings(value ...string) string

func (*ApplicationInfo) PrintInfo

func (instance *ApplicationInfo) PrintInfo() string

func (*ApplicationInfo) PrintLicense

func (instance *ApplicationInfo) PrintLicense() string

func (*ApplicationInfo) Refresh

func (instance *ApplicationInfo) Refresh() *ApplicationInfo

func (*ApplicationInfo) SetLicense

func (instance *ApplicationInfo) SetLicense(license *license_commons.License)

func (*ApplicationInfo) StartedAgo

func (instance *ApplicationInfo) StartedAgo() (response string)

func (*ApplicationInfo) String

func (instance *ApplicationInfo) String() string

type ApplicationInfoError

type ApplicationInfoError struct {
	Context string `json:"context"`
	Error   string `json:"error"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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