cmd

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableRestart

func DisableRestart()

DisableRestart disables restart once `RestartApp` is called.

func GenerateVersionFiles

func GenerateVersionFiles(updates *updates.Updates, dir string)

GenerateVersionFiles writes a JSON file with details about current build. Those files are used for upgrading the app.

func Main

func Main(appName, usage string, extraFlags []cli.Flag, run func(*cli.Context) error)

Main sets up Sentry, filters out unwanted args, creates app and runs it.

func MakeMemoryProfile

func MakeMemoryProfile()

MakeMemoryProfile generates memory pprof.

func RestartApp

func RestartApp()

RestartApp starts a new instance in background.

func StartCPUProfile

func StartCPUProfile()

StartCPUProfile starts CPU pprof.

Types

type PanicHandler

type PanicHandler struct {
	AppName string
	Config  *config.Config
	Err     *error // Pointer to error of cli action.
}

PanicHandler defines HandlePanic which can be used anywhere in defer.

func (*PanicHandler) HandlePanic

func (ph *PanicHandler) HandlePanic()

HandlePanic should be called in defer to ensure restart of app after error.

Jump to

Keyboard shortcuts

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