Sharpening my Golang skills with coding challenges and skunkworks.
Some packages are only executed as unit tests, others can be run as commands using the
-c <command> argument. The -l argument will list the available commands.
- This repository is currently transitioning from a single
main.goto multiplecmdpackages
- This repository may minimize third-party library dependencies, but not obsessively so as a goal in itself.
- Opportunities may be taken for learning or other purposes to implement functionality here that is available in third-party libraries. These may be replaced with third-party libraries in the future as needs and interest change or time allows.
- Reusable code is extracted to github.com/mikebd/go-util
docker build -t go-sharpen-blade .- Build the Docker imagedocker run go-sharpen-blade- Run without arguments
OR
docker run go-sharpen-blade /app/go-sharpen-blade <args>- Run with the given arguments
go run ./main <args>- Run the main.go file with the given arguments
| Argument | Description |
|---|---|
-c <command> |
Command to run |
-d <directory> |
Working directory |
-h | --help |
Print the help message |
-l |
List commands |
-lt |
Log with timestamps (UTC) |
-o11y-prometheus |
Enable Prometheus metrics |
When run with -o11y-prometheus -c <command>, prometheus metrics are exposed on :2112/metrics.
The program will wait for 20 seconds before exiting, so that the metrics can be scraped.
prometheus.yml:
scrape_configs:
- job_name: sharpen_blade
scrape_interval: 10s
static_configs:
- targets:
- localhost:2112