sneak/integrate-di (#17)
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
moving this to use uber/fx di framework instead of the ad hoc di setup before Co-authored-by: sneak <sneak@sneak.berlin> Reviewed-on: #17
This commit was merged in pull request #17.
This commit is contained in:
27
internal/globals/globals.go
Normal file
27
internal/globals/globals.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package globals
|
||||
|
||||
import (
|
||||
"go.uber.org/fx"
|
||||
)
|
||||
|
||||
// these get populated from main() and copied into the Globals object.
|
||||
var (
|
||||
Appname string
|
||||
Version string
|
||||
Buildarch string
|
||||
)
|
||||
|
||||
type Globals struct {
|
||||
Appname string
|
||||
Version string
|
||||
Buildarch string
|
||||
}
|
||||
|
||||
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