network

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeNetworkInterface

type BridgeNetworkInterface struct {
	// For `type = "bridge" interfaces, the name of the host bridge device which the domain connects to
	Bridge string `mapstructure:"bridge" required:"false"`
}

func (*BridgeNetworkInterface) PrepareConfig

func (ni *BridgeNetworkInterface) PrepareConfig(ctx *interpolate.Context) (warnings []string, errs []error)

func (BridgeNetworkInterface) UpdateDomainInterface

func (ni BridgeNetworkInterface) UpdateDomainInterface(domainInterface *libvirtxml.DomainInterface)

type FlatNetworkInterface

type FlatNetworkInterface struct {
	Type    *string `mapstructure:"type" required:"true" cty:"type" hcl:"type"`
	Mac     *string `mapstructure:"mac" required:"false" cty:"mac" hcl:"mac"`
	Alias   *string `mapstructure:"alias" required:"false" cty:"alias" hcl:"alias"`
	Model   *string `mapstructure:"model" required:"false" cty:"model" hcl:"model"`
	Bridge  *string `mapstructure:"bridge" required:"false" cty:"bridge" hcl:"bridge"`
	Network *string `mapstructure:"network" required:"false" cty:"network" hcl:"network"`
}

FlatNetworkInterface is an auto-generated flat version of NetworkInterface. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatNetworkInterface) HCL2Spec

func (*FlatNetworkInterface) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a NetworkInterface. This spec is used by HCL to read the fields of NetworkInterface. The decoded values from this spec will then be applied to a FlatNetworkInterface.

type ManagedNetworkInterface

type ManagedNetworkInterface struct {
	// If `type = "managed", the name of the Libvirt managed virtual network`. Defaults to the `default` network
	Network string `mapstructure:"network" required:"false"`
}

func (*ManagedNetworkInterface) PrepareConfig

func (ni *ManagedNetworkInterface) PrepareConfig(ctx *interpolate.Context) (warnings []string, errs []error)

func (*ManagedNetworkInterface) UpdateDomainInterface

func (ni *ManagedNetworkInterface) UpdateDomainInterface(domainInterface *libvirtxml.DomainInterface)

type NetworkInterface

type NetworkInterface struct {
	// [required] Type of attached network interface
	Type string `mapstructure:"type" required:"true"`
	// [optional] If needed, a MAC address can be specified for the network interface.
	// If not specified, Libvirt will generate and assign a random MAC address
	Mac string `mapstructure:"mac" required:"false"`
	// [optional] To help users identifying devices they care about, every device can have an alias which must be unique within the domain.
	// Additionally, the identifier must consist only of the following characters: `[a-zA-Z0-9_-]`.
	Alias string `mapstructure:"alias" required:"false"`
	// [optional] Defines how the interface should be modeled for the domain.
	// Typical values for QEMU and KVM include: `ne2k_isa` `i82551` `i82557b` `i82559er` `ne2k_pci` `pcnet` `rtl8139` `e1000` `virtio`.
	// If nothing is specified, `virtio` will be used as a default.
	Model string `mapstructure:"model" required:"false"`

	Bridge  BridgeNetworkInterface  `mapstructure:",squash"`
	Managed ManagedNetworkInterface `mapstructure:",squash"`
}

func (NetworkInterface) DomainInterface

func (ni NetworkInterface) DomainInterface() *libvirtxml.DomainInterface

func (*NetworkInterface) FlatMapstructure

func (*NetworkInterface) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatNetworkInterface. FlatNetworkInterface is an auto-generated flat version of NetworkInterface. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*NetworkInterface) PrepareConfig

func (ni *NetworkInterface) PrepareConfig(ctx *interpolate.Context) (warnings []string, errs []error)

Jump to

Keyboard shortcuts

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