imds

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package imds is a latency timing source for the EC2 Instance Metadata Service (IMDS)

Index

Constants

This section is empty.

Variables

View Source
var (
	Name             = "EC2 IMDS"
	DynamicDocPrefix = "/dynamic/instance-identity/document"
	RequestedTime    = fmt.Sprintf("%s/%s", DynamicDocPrefix, "requestedTime")
	PendingTime      = fmt.Sprintf("%s/%s", DynamicDocPrefix, "pendingTime")
)

Functions

This section is empty.

Types

type ErrMetadata

type ErrMetadata struct{}

func (ErrMetadata) Error

func (e ErrMetadata) Error() string

type IMDSSource

type IMDSSource struct {
	// contains filtered or unexported fields
}

IMDSSource is the EC2 Instance Metadata Service (IMDS) http source

func New

func New(imdsClient *imds.Client) *IMDSSource

New instantiates a new instance of the IMDS source

func (IMDSSource) ClearCache

func (i IMDSSource) ClearCache()

ClearCache is a noop for the IMDS Source since it is an http source, not a log file

func (IMDSSource) Find

func (i IMDSSource) Find(search string, firstOccurrence bool) (time.Time, error)

Find queries the EC2 Instance Metadata Service (IMDS) for the search path and expects to find a time. The only supported paths currently are "/dynamic/instance-identity/document/pendingTime" and "/dynamic/instance-identity/document/requestedTime"

func (IMDSSource) Name

func (i IMDSSource) Name() string

Name is the name of the source

func (IMDSSource) String

func (i IMDSSource) String() string

Jump to

Keyboard shortcuts

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