environment

package
v0.0.0-...-05ee0c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

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 Compiled

func Compiled() time.Time

Compiled returns the time.Time representation of the application's build timestamp.

func NewContext

func NewContext() context.Context

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL