33 lines
808 B
Go
33 lines
808 B
Go
|
|
package authjwt
|
||
|
|
|
||
|
|
import (
|
||
|
|
"runtime/debug"
|
||
|
|
|
||
|
|
"code.nochebuena.dev/einherjar/contracts/observability"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Module identifies this package to observability systems.
|
||
|
|
// auth-jwt is a function library — it is not registered with the launcher as a
|
||
|
|
// lifecycle component. Register Module manually with any version registry if needed.
|
||
|
|
var Module observability.Identifiable = &moduleID{}
|
||
|
|
|
||
|
|
type moduleID struct{}
|
||
|
|
|
||
|
|
const modulePath = "code.nochebuena.dev/einherjar/auth-jwt"
|
||
|
|
|
||
|
|
func (m *moduleID) ModulePath() string { return modulePath }
|
||
|
|
|
||
|
|
func (m *moduleID) ModuleVersion() string {
|
||
|
|
if info, ok := debug.ReadBuildInfo(); ok {
|
||
|
|
for _, dep := range info.Deps {
|
||
|
|
if dep.Path == modulePath {
|
||
|
|
return dep.Version
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if info.Main.Path == modulePath {
|
||
|
|
return info.Main.Version
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return "(devel)"
|
||
|
|
}
|