awsutil

package
v0.0.0-...-835b7ae Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

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 IsECS

func IsECS(do DetectOutput) bool

IsECS returns whether this is running in an ECS task

func IsEKS

func IsEKS(do DetectOutput) bool

IsEKS returns whether this is running in an EKS pod

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

Jump to

Keyboard shortcuts

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