Documentation ¶
Overview ¶
Package environment contains utilities for interacting with the application's environment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ApplicationName is the name of the application, injected at build time. ApplicationName string // ApplicationDescription is the description of the application, injected at build time. ApplicationDescription string // Version is the version of the application, injected at build time. Version string )
View Source
var Flags = flag.Flags{ &flag.Boolean{ Name: "auto-max-procs-disabled", Usage: "Disables automatically setting GOMAXPROCS to the linux CPU quota", EnvVar: "AUTO_MAX_PROCS_DISABLED", Destination: &autoMaxProcsDisabled, Hidden: true, }, }
Flags contains all command-line flags that can be used to configure the application environment.
Functions ¶
func NewContext ¶
NewContext returns a new context.Context implementation that will cancel when the current process receives an exit signal. Should be used for graceful shutdowns.
func SetMaxProcsToCPUQuota ¶
func SetMaxProcsToCPUQuota()
SetMaxProcsToCPUQuota sets GOMAXPROCS to match the Linux container CPU quota (if any).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.