Add proper godoc comments to exported items in: - internal/globals: Appname, Version, Commit variables; Globals type; New function - internal/log: LogLevel type; level constants; Config type; Initialize, Fatal, Error, Warn, Notice, Info, Debug functions and variants; TTYHandler type and methods; Module variable; LogOptions type
32 lines
685 B
Go
32 lines
685 B
Go
package globals
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Appname is the application name, populated from main().
|
|
var Appname string = "vaultik"
|
|
|
|
// Version is the application version, populated from main().
|
|
var Version string = "dev"
|
|
|
|
// Commit is the git commit hash, populated from main().
|
|
var Commit string = "unknown"
|
|
|
|
// Globals contains application-wide configuration and metadata.
|
|
type Globals struct {
|
|
Appname string
|
|
Version string
|
|
Commit string
|
|
StartTime time.Time
|
|
}
|
|
|
|
// New creates and returns a new Globals instance initialized with the package-level variables.
|
|
func New() (*Globals, error) {
|
|
return &Globals{
|
|
Appname: Appname,
|
|
Version: Version,
|
|
Commit: Commit,
|
|
}, nil
|
|
}
|