https://github.com/txn2/micro
WIP: TXN2 micro server (gin-gonic wrapper)
https://github.com/txn2/micro
Last synced: 12 months ago
JSON representation
WIP: TXN2 micro server (gin-gonic wrapper)
- Host: GitHub
- URL: https://github.com/txn2/micro
- Owner: txn2
- License: apache-2.0
- Created: 2019-04-15T07:13:02.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-24T21:09:20.000Z (almost 3 years ago)
- Last Synced: 2025-06-02T07:13:25.016Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 52.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://goreportcard.com/report/github.com/txn2/micro)
[](https://godoc.org/github.com/txn2/micro)
WIP: Micro wraps gin-gonic and contains flag and environment variable configuration for
providing health and metrics endpoints:
- Basic Auth protected `/healthz` for liveness probes.
- Prometheus metrics on port **2112** at `/metrics`.
Review the example implementation in [./examples/server.go](https://github.com/txn2/micro/blob/master/example/server.go)
## Configuration
| Flag | Environment Variable | Description |
|:--------------|:---------------------|:-------------------------------------------------------|
| -help | | Display help |
| -debug | DEBUG | Debug logging mode (default false) |
| -ip | IP | Server IP address to bind to. (default "127.0.0.1") |
| -port | PORT | Server port. (default "8080") |
| -healthz | HEALTHZ | Enable or disable /healthz (default true) |
| -healthzUser | HEALTHZ_USER | /healthz basic auth username (default "healthz") |
| -healthzPass | HEALTHZ_PASS | /healthz basic auth password (default "healthz") |
| -logout | LOGOUT | log output stdout \| (default "stdout") |
| -metric | METRICS | Enable or Disable metrics (default true) |
| -metricsIP | METRICS_IP | Falls back to same IP as server. (default "127.0.0.1") |
| -metricsPort | METRICS_PORT | Metrics port. (default "2112") |
| -readTimeout | READ_TIMEOUT | HTTP read timeout in seconds (default 10) |
| -writeTimeout | WRITE_TIMEOUT | HTTP write timeout (default 10) |
| -tokenExp | TOKEN_EXP | JWT Token expiration in minutes (default 10) |
| -tokenKey | TOKEN_KEY | JWT Token Key |
| | AGENT | Populates the agent key of Ack. |
| | SERVICE_ENV | Populates the srv_env key of [Ack]. |
| | SERVICE_NS | Populates the srv_ns key of [Ack]. |
[Ack]: https://github.com/txn2/ack