Add basic webserver skeleton with healthcheck
This commit is contained in:
31
internal/globals/globals.go
Normal file
31
internal/globals/globals.go
Normal file
@@ -0,0 +1,31 @@
|
||||
// Package globals provides application-wide constants set at build time.
|
||||
package globals
|
||||
|
||||
import (
|
||||
"go.uber.org/fx"
|
||||
)
|
||||
|
||||
// Build-time variables populated from main() via ldflags.
|
||||
var (
|
||||
Appname string //nolint:gochecknoglobals // set from main
|
||||
Version string //nolint:gochecknoglobals // set from main
|
||||
Buildarch string //nolint:gochecknoglobals // set from main
|
||||
)
|
||||
|
||||
// Globals holds application-wide constants.
|
||||
type Globals struct {
|
||||
Appname string
|
||||
Version string
|
||||
Buildarch string
|
||||
}
|
||||
|
||||
// New creates a new Globals instance from build-time variables.
|
||||
func New(lc fx.Lifecycle) (*Globals, error) {
|
||||
n := &Globals{
|
||||
Appname: Appname,
|
||||
Buildarch: Buildarch,
|
||||
Version: Version,
|
||||
}
|
||||
|
||||
return n, nil
|
||||
}
|
||||
Reference in New Issue
Block a user