All Projects → alecthomas → Bootstrap

alecthomas / Bootstrap

Go application bootstrapping

Programming Languages

go
31211 projects - #10 most used programming language

General application utilities

The functionality is split up into "modules", activated with a bitmask.

app := kingpin.New("app", "Description.")
util.Bootstrap(app, util.LoggingModule|util.DebugModule|util.PIDFileModule|util.DaemonizeModule, &util.Options{
		LogToStderrByDefault: true,
		UseSystemPIDFilePath: true,
})

Modules

Module flag Provided functionality
util.LoggingModule Configurable logging via flags, including sinks and levels.
util.DebugModule Add a util.DebugFlag, also used by some of the other modules.
util.PIDFileModule Prevent multiple instances of the application running, via a --pid-file flag.
util.DaemonizeModule Add --daemon flag which daemonizes the process. Usually used in conjunection with util.PIDFileModule.

As a convenience, you can use util.AllModules to activate all modules.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].