utils

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: Apache-2.0, Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NextDeviceInfo = &types.NextDeviceInfo{
	Prefix:  "xvd",
	Pattern: "[f-p]",
	Ignore:  false,
}

NextDeviceInfo is the NextDeviceInfo object for EBS.

EBS suggests to use /dev/sd[f-p] for Linux EC2 instances. Also on Linux EC2 instances, although the device path may show up as /dev/sd* on the EC2 side, it will appear locally as /dev/xvd*

Functions

func BlockDeviceName

func BlockDeviceName(
	ctx types.Context,
	device string) ([]byte, error)

BlockDeviceName returns the name of the provided EBS device.

func BlockDevices

func BlockDevices(ctx types.Context) ([]byte, error)

BlockDevices returns the EBS devices attached to the local host.

func InstanceID

func InstanceID(ctx types.Context) (*types.InstanceID, error)

InstanceID returns the instance ID for the local host.

func IsEC2Instance

func IsEC2Instance(ctx types.Context) (bool, error)

IsEC2Instance returns a flag indicating whether the executing host is an EC2 instance based on whether or not the metadata URL can be accessed.

func LocalDevices

func LocalDevices(
	ctx types.Context,
	opts *types.LocalDevicesOpts) (*types.LocalDevices, error)

LocalDevices retrieves device paths currently attached and/or mounted

func NextDevice

func NextDevice(
	ctx types.Context,
	opts types.Store) (string, error)

NextDevice returns the next available device.

Types

This section is empty.

Jump to

Keyboard shortcuts

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