imds

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 6 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"
	PendingTime      = fmt.Sprintf("%s/%s", DynamicDocPrefix, "pendingTime")
)

Functions

This section is empty.

Types

type Source added in v0.1.1

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

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

func New

func New(imdsClient *imds.Client) *Source

New instantiates a new instance of the IMDS source

func (Source) ClearCache added in v0.1.1

func (i Source) ClearCache()

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

func (Source) Find added in v0.1.1

func (i Source) Find(event *sources.Event) ([]sources.FindResult, error)

Find will use the Event's FindFunc and CommentFunc to search the source and return the result

func (Source) FindByPath added in v0.1.7

func (i Source) FindByPath(path string) sources.FindFunc

FindByPath is a helper func that returns a FindFunc to query IMDS for a specific HTTP path that can be used in an Event

func (Source) GetMetadata added in v0.1.7

func (i Source) GetMetadata(path string) (string, error)

GetMetadata queries EC2 IMDS

func (Source) Name added in v0.1.1

func (i Source) Name() string

Name is the name of the source

func (Source) String added in v0.1.1

func (i Source) String() string

String is a human readable string of the source

Jump to

Keyboard shortcuts

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