- Go 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Closes #7 Monitoring plan, phase 5 rollout, same as the pilots argus/backend#45 and argus/frontend#35. ## Changes (`.forgejo/workflows/ci.yml`) - New step "Collect publish details for Argus": `/tmp/dependencies.txt` = the direct requirements of `go.mod` (`module version` lines). A Go module has no artifact of its own, so the report carries the version, the release page and the dependencies. There is no devel snapshot here, so only the numbered release sends a report. - The publish-release call (numbered release; no devel snapshot here) gets `ARGUS_UPLOAD_TOKEN: ${{ secrets.ARGUS_UPLOAD_TOKEN }}` and `--dependencies /tmp/dependencies.txt`. A failed upload only warns, the release itself is unaffected. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA Reviewed-on: #8 |
||
| .forgejo/workflows | ||
| docs | ||
| .gitignore | ||
| client.go | ||
| config.go | ||
| COPYING | ||
| COPYING.LESSER | ||
| go.mod | ||
| go.sum | ||
| middleware.go | ||
| README.md | ||
| registry.go | ||
| registry_test.go | ||
| renovate.json | ||
vieuxhibou-gin
Structured logging for Gin services:
a hot-reloadable slog logger registry (NOTSET/DEBUG/INFO/WARNING/ERROR/
CRITICAL levels, a table aligned with
vieuxhibou-django
so both share the same dashboard), a middleware exposing a /loggers/
API to read/change them, and optional registration/heartbeat with a
central vieuxhibou server.
Installation
go get git.stationmyr.net/Gilles/vieuxhibou-gin@latest
(requires GOPROXY to point at this Forgejo instance's Go registry, or
direct VCS mode -- private instance).
Usage
import "git.stationmyr.net/Gilles/vieuxhibou-gin"
func main() {
vieuxhibou.Configure(vieuxhibou.Config{
ServiceName: "my-service",
Env: "prod",
Version: "1.2.3",
// Empty disables registration/heartbeat.
ServerURL: "https://vieuxhibou.example.org",
SelfURL: "https://my-service.example.org",
SharedToken: os.Getenv("VIEUXHIBOU_SHARED_TOKEN"),
})
log := vieuxhibou.Logger("myapp.tasks")
log.Info("started")
router := gin.Default()
vh := router.Group("/vieuxhibou")
vieuxhibou.Mount(vh) // GET/POST /vieuxhibou/loggers/...
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
go vieuxhibou.StartHeartbeat(ctx, slog.Default())
router.Run()
}
The /loggers/ API (reading and writing levels) only has shared-token
authentication (SharedToken, no notion of a user session): only expose
it behind a forward-auth layer (Traefik/Authentik) if direct human access
is wanted.
Release
No build/publish step for untagged code: go get git.stationmyr.net/Gilles/vieuxhibou-gin@master already resolves a
pseudo-version automatically. A real release is a semver tag (vX.Y.Z),
pushed via a manual trigger of the ci workflow (Actions tab → "Run
workflow" → version field); Forgejo's built-in Go proxy then serves it
on its own.
Development
gofmt -l . # formatting
go vet ./... # static analysis
go test ./... # tests
go tool gotestsum -- ./... -coverprofile=coverage.out # tests + coverage, JUnit-ready (CI)
go tool cover -html=coverage.out # coverage report in the browser
License
LGPLv3, see COPYING + COPYING.LESSER -- chosen over GPLv3 precisely because this package is meant to be imported (hence "linked", in the LGPL sense) by projects that have no reason to be GPL themselves.