base

package
v2.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Overview

Package base implements a common application base currently shared by bridge and IE. The base includes the following:

  • access to standard filesystem locations like config, cache, logging dirs
  • an extensible crash handler
  • versioned cache directory
  • persistent settings
  • event listener
  • credentials store
  • pmapi Manager

In addition, the base initialises logging and reacts to command line arguments which control the log verbosity and enable cpu/memory profiling.

Index

Constants

View Source
const (
	FlagGRPC      = "grpc" // FlagGRPC starts the gRPC frontend
	FlagGRPCShort = "g"
	FlagCLI       = "cli" // FlagCLI indicate to start with command line interface.

	FlagLauncher  = "launcher"
	FlagNoWindow  = "no-window"
	FlagParentPID = "parent-pid"
)

Variables

This section is empty.

Functions

Types

type Base

type Base struct {
	SentryReporter *sentry.Reporter
	CrashHandler   *crash.Handler
	Locations      *locations.Locations
	Settings       *settings.Settings
	Lock           *os.File
	Cache          *cache.Cache
	Listener       listener.Listener
	Creds          *credentials.Store
	CM             pmapi.Manager
	CookieJar      *cookies.Jar
	UserAgent      *useragent.UserAgent
	Updater        *updater.Updater
	Versioner      *versioner.Versioner
	TLS            *tls.TLS
	Autostart      *autostart.App

	Name string // the app's name
	// contains filtered or unexported fields
}

func New

func New(
	appName,
	appUsage,
	configName,
	updateURLName,
	keychainName,
	cacheVersion string,
) (*Base, error)

func (*Base) AddTeardownAction

func (b *Base) AddTeardownAction(fn func() error)

AddTeardownAction adds an action to perform during app teardown.

func (*Base) ForceLauncher added in v2.4.0

func (b *Base) ForceLauncher(launcher string)

func (*Base) NewApp

func (b *Base) NewApp(mainLoop func(*Base, *cli.Context) error) *cli.App

func (*Base) SetMainExecutable added in v2.4.0

func (b *Base) SetMainExecutable(exe string)

func (*Base) SetToRestart

func (b *Base) SetToRestart()

SetToRestart sets the app to restart the next time it is closed.

Jump to

Keyboard shortcuts

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