Add backend with buffered zstd-compressed report storage
Introduce the Go backend (netwatch-server) with an HTTP API that accepts telemetry reports and persists them as zstd-compressed JSONL files. Reports are buffered in memory and flushed to disk when the buffer reaches 10 MiB or every 60 seconds.
This commit is contained in:
31
backend/internal/globals/globals.go
Normal file
31
backend/internal/globals/globals.go
Normal file
@@ -0,0 +1,31 @@
|
||||
// Package globals provides build-time variables injected via
|
||||
// ldflags and made available through dependency injection.
|
||||
package globals
|
||||
|
||||
import "go.uber.org/fx"
|
||||
|
||||
//nolint:gochecknoglobals // set from main before fx starts
|
||||
var (
|
||||
// Appname is the application name.
|
||||
Appname string
|
||||
// Version is the git version tag.
|
||||
Version string
|
||||
// Buildarch is the build architecture.
|
||||
Buildarch string
|
||||
)
|
||||
|
||||
// Globals holds build-time metadata for the application.
|
||||
type Globals struct {
|
||||
Appname string
|
||||
Version string
|
||||
Buildarch string
|
||||
}
|
||||
|
||||
// New creates a Globals instance from package-level variables.
|
||||
func New(_ fx.Lifecycle) (*Globals, error) {
|
||||
return &Globals{
|
||||
Appname: Appname,
|
||||
Buildarch: Buildarch,
|
||||
Version: Version,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user