Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfStringFlag = altsrc.NewStringFlag
View Source
var DefaultHandledSignals = []os.Signal{ unix.SIGTERM, unix.SIGINT, unix.SIGHUP, unix.SIGPIPE, }
nolint:revive
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger = *logging.ZapEventLogger // FIXME make it an actual interface
nolint:revive
type StringFlag ¶
type StringFlag = cli.StringFlag
type UFcli ¶
type UFcli struct { AppConfig cli.App // stock urfavecli App configuration TOMLPath string // optional path of TOML config file read via https://pkg.go.dev/github.com/urfave/cli/v2/altsrc AllowConcurrentRuns bool // if set allows multiple concurrent runs of the same command GlobalInit func(cctx *cli.Context, uf *UFcli) (resourceCloser func() error, err error) // optional initialization routines (setup RDBMS pool, etc) BeforeShutdown func() error // optional function to execute before the top context is cancelled ( unlike resourceCloser above ) HandleSignals []os.Signal // if empty defaults to DefaultHandledSignals Logger Logger // optional ZapEventLogger-compatible object // contains filtered or unexported fields }
UFcli is a urfavecli/v2/cli.App wrapper with simplified error and signal handling. It also provides correct init/shutdown hookpoints, and proper locking preventing the same app/command from running more than once.
func (*UFcli) RunAndExit ¶
RunAndExit will excute any init routines, run the app, and os.Exit() after shutdown
Click to show internal directories.
Click to hide internal directories.