hardwaremapping

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MPL-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PathPCIValueRegEx is the regular expression for a PCI hardware mapping path.
	PathPCIValueRegEx = regexp.MustCompile(`^[a-f0-9]{4,}:[a-f0-9]{2}:[a-f0-9]{2}(\.[a-f0-9])?$`)

	// PathUSBValueRegEx is the regular expression for a USB hardware mapping path.
	PathUSBValueRegEx = regexp.MustCompile(`^\d+-(\d+)(\.\d+)?$`)
)
View Source
var ErrValueConversion = func(format string, attrs ...any) error {

	return function.NewFuncError(fmt.Sprintf(format, attrs...))
}

ErrValueConversion indicates an error while converting a value for a hardware mapping path.

Functions

This section is empty.

Types

type PathType

type PathType struct {
	basetypes.StringType
	Type proxmoxtypes.Type
}

PathType is a type that represents a path of a hardware mapping.

func (PathType) Equal

func (t PathType) Equal(o attr.Type) bool

Equal returns true if the two types are equal.

func (PathType) String

func (t PathType) String() string

String returns a string representation of the type.

func (PathType) ValueFromString

ValueFromString converts a string value to a StringValuable.

func (PathType) ValueFromTerraform

func (t PathType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

ValueFromTerraform converts a Terraform value to a StringValuable.

func (PathType) ValueType

func (t PathType) ValueType(_ context.Context) attr.Value

ValueType returns the underlying value type.

type PathValue

type PathValue struct {
	basetypes.StringValue
}

PathValue is a type that represents the value of a hardware mapping path.

func NewPathPointerValue

func NewPathPointerValue(value *string) PathValue

NewPathPointerValue returns a new PathValue from a string pointer.

func (PathValue) Equal

func (v PathValue) Equal(o attr.Value) bool

Equal returns true if the two values are equal.

func (PathValue) IsProxmoxType

func (v PathValue) IsProxmoxType(hmType proxmoxtypes.Type) bool

IsProxmoxType checks whether the value match the given hardware mapping type.

func (PathValue) Type

func (v PathValue) Type(_ context.Context) attr.Type

Type returns the type of the value.

Jump to

Keyboard shortcuts

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