imds

package
v1.15.22 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVMUniqueIDNotFound   = errors.New("vm unique ID not found")
	ErrUnexpectedStatusCode = errors.New("imds returned an unexpected status code")
)

Functions

This section is empty.

Types

type Client

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

Client returns metadata about the VM by querying IMDS

func NewClient

func NewClient(opts ...ClientOption) *Client

NewClient creates a new imds client

func (*Client) GetVMUniqueID

func (c *Client) GetVMUniqueID(ctx context.Context) (string, error)

type ClientOption

type ClientOption func(*clientConfig)

func Endpoint

func Endpoint(endpoint string) ClientOption

Endpoint overrides the default endpoint for a Client

func RetryAttempts

func RetryAttempts(attempts uint) ClientOption

RetryAttempts overrides the default retry attempts for the client

Jump to

Keyboard shortcuts

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