Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDocker ¶
func IsDocker(do DetectOutput) bool
IsDocker returns whether this is running in a docker container (and is not ECS, EKS, or kubernetes)
func IsEC2 ¶
func IsEC2(do DetectOutput) bool
IsEC2 returns whether this is running in an EC2 instance
func IsKubernetes ¶
func IsKubernetes(do DetectOutput) bool
IsKubernetes returns whether this is running in a kubernetes pod (and is not EKS)
func IsLambda ¶
func IsLambda(do DetectOutput) bool
IsLambda returns whether this is running in a Lambda function
Types ¶
type ComputeType ¶
type ComputeType int
ComputeType is an enum for different compute types
const ( // ComputeUnknown is when the compute type could not be identified ComputeUnknown ComputeType = iota // ComputeEC2 is running in an EC2 instance ComputeEC2 // ComputeDocker is running in a docker container (and is not ECS, EKS, or kubernetes) ComputeDocker // ComputeKubernetes is running in a kubernetes pod (and is not EKS) ComputeKubernetes // ComputeECS is running in an ECS task ComputeECS // ComputeEKS is running in an EKS pod ComputeEKS // ComputeLambda is running in a Lambda function ComputeLambda )
func (ComputeType) String ¶
func (ct ComputeType) String() string
String is the string representation of the ComputeType
type DetectOutput ¶
type DetectOutput struct {
Type ComputeType
}
DetectOutput is the output struct for the Detect() function
func Detect ¶
func Detect() DetectOutput
Detect attempts to determine the compute type of the currently running code.
func (DetectOutput) IsDocker ¶
func (do DetectOutput) IsDocker() bool
IsDocker returns whether this is running in a docker container (and is not ECS, EKS, or kubernetes)
func (DetectOutput) IsEC2 ¶
func (do DetectOutput) IsEC2() bool
IsEC2 returns whether this is running in an EC2 instance
func (DetectOutput) IsECS ¶
func (do DetectOutput) IsECS() bool
IsECS returns whether this is running in an ECS task
func (DetectOutput) IsEKS ¶
func (do DetectOutput) IsEKS() bool
IsEKS returns whether this is running in an EKS pod
func (DetectOutput) IsKubernetes ¶
func (do DetectOutput) IsKubernetes() bool
IsKubernetes returns whether this is running in a kubernetes pod (and is not EKS)
func (DetectOutput) IsLambda ¶
func (do DetectOutput) IsLambda() bool
IsLambda returns whether this is running in a Lambda function
func (DetectOutput) String ¶
func (do DetectOutput) String() string
String is the string representation of the ComputeType