dto

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateMachineAddressFromSwitchInterface

func CalculateMachineAddressFromSwitchInterface(
	switchNIC Interface,
) metalv1alpha4.Addresses

func FilterAndGenerateAddresses

func FilterAndGenerateAddresses(
	switchInterface Interface,
	ipTypeFunc func(addr netip.Addr) bool,
) []metalv1alpha4.IPAddrSpec

func IsIPv4

func IsIPv4(addr netip.Addr) bool

func IsIPv6

func IsIPv6(addr netip.Addr) bool

func ToMachineInterfaces

func ToMachineInterfaces(nics []metalv1alpha4.NICSpec) []metalv1alpha4.Interface

Types

type Interface

type Interface struct {
	IP []netip.Prefix
}

type InventoryInfo

type InventoryInfo struct {
	UUID      string
	Namespace string
}

type MachineInfo

type MachineInfo struct {
	UUID         string
	Namespace    string
	ProductSKU   string
	SerialNumber string
	Sizes        map[string]string
	Interfaces   []metalv1alpha4.Interface
}

func NewMachineInfoFromInventory

func NewMachineInfoFromInventory(inv domain.Inventory) MachineInfo

type Request

type Request struct {
	Name      string
	Namespace string
}

type SubnetInfo

type SubnetInfo struct {
	Name             string
	Namespace        string
	Prefix           int
	ParentSubnetName string
}

func NewSubnetInfo

func NewSubnetInfo(
	name string,
	namespace string,
	prefix int,
	parentSubnetName string,
) SubnetInfo

type SwitchInfo

type SwitchInfo struct {
	Name           string
	Lanes          uint32
	InterfacesInfo map[string]Interface
	Interfaces     *metalv1alpha4.InterfaceSpec
}

func (*SwitchInfo) AddSwitchInfoToMachineInterfaces

func (s *SwitchInfo) AddSwitchInfoToMachineInterfaces(
	machineInterface metalv1alpha4.Interface,
) metalv1alpha4.Interface

Jump to

Keyboard shortcuts

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