https://github.com/alecthomas/bootstrap
Go application bootstrapping
https://github.com/alecthomas/bootstrap
Last synced: over 1 year ago
JSON representation
Go application bootstrapping
- Host: GitHub
- URL: https://github.com/alecthomas/bootstrap
- Owner: alecthomas
- Created: 2014-06-26T07:10:54.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2023-12-02T14:25:19.000Z (over 2 years ago)
- Last Synced: 2025-02-28T07:49:34.564Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# General application utilities
The functionality is split up into "modules", activated with a bitmask.
```go
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.