Documentation
¶
Overview ¶
Provides various information about the current runtime of the application
Index ¶
Constants ¶
const ( // ProfileDebug is the default Profile intended to be used when developing the app. ProfileDebug = iota // ProfileTest is the Profile intended to be used in unit tests. ProfileTest // ProfileRelease is the Profile intended to be enabled when the app is distributed in its binary form. ProfileRelease )
Variables ¶
This section is empty.
Functions ¶
func GetEnvironment ¶
func GetEnvironment() string
GetEnvironment returns the environment name. It's taken from "environment" key of the global config.Config. The default value is "default".
func GetProfileString ¶
func GetProfileString() string
GetProfileString returns the current Profile value, taken from GetProfile, in its string form.
func IsTerminal ¶
func IsTerminal() bool
IsTerminal checks whether the app is being run inside an interactive terminal
Types ¶
type AppInfo ¶
type AppInfo struct { // Name is the name of the application. Name string // Version is the version of the application. Version string // Environment is the name of the current environment, taken from GetEnvironment. Environment string // Profile is the string representation of current Profile, taken from GetProfileString. Profile string // Hostname is the hostname currently set in the system. Hostname string // StartupTime is the exact time when the application was started. StartupTime time.Time // BuildCommit is a Git revision from which the app was build. BuildCommit string // BuildCommit is the time in which Git revision used to build the app has been made. BuildTime string }
AppInfo represents some basic information about the current app's runtime.
type Profile ¶
type Profile = int
Profile represents a global setting of the application, making changes to its default behaviors.
func GetProfile ¶
func GetProfile() Profile
GetProfile returns the current Profile of the app. It's taken from "profile" key of the global config.Config. The default value is ProfileDebug. GetProfile caches the profile value when called for the first time.