cpu

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ArchX86 represents a 64-bit CPU using an x86-based instruction set
	ArchX86 = Architecture{
			// contains filtered or unexported fields
	}

	// ArchARM represents a 64-bit CPU using an ARM-based instruction set
	ArchARM = Architecture{
			// contains filtered or unexported fields
	}
)

If adding a new Arch, be sure to add it to Architecture.IsValid() and cpu.ArchitectureByName()

Functions

This section is empty.

Types

type Architecture

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

Architecture type represents specific CPU architectures and stores information on how they map to cloud instance types. The verifier currently supports two: cpu.ArchX86 and cpu.ArchARM

func ArchitectureByName

func ArchitectureByName(name string) Architecture

ArchitectureByName returns an Architecture supported by the verifier if the given name matches any known common names for a supported Architecture. It returns an empty/invalid architecture if the provided name isn't supported

func (Architecture) DefaultInstanceType

func (arch Architecture) DefaultInstanceType(platformType cloud.Platform) (string, error)

DefaultInstanceType returns a sane default instance/machine type for the given cloud platform

func (Architecture) IsValid

func (arch Architecture) IsValid() bool

IsValid returns true if the Architecture is non-empty and supported by the network verifier

func (Architecture) String

func (arch Architecture) String() string

String returns the "preferred name" of the Architecture

Jump to

Keyboard shortcuts

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