Documentation ¶
Index ¶
- func Gb(value uint64) uint64
- func Gbps(value uint64) uint64
- func Kb(value uint64) uint64
- func Mb(value uint64) uint64
- func Mbps(value uint64) uint64
- func Mhz(value uint64) uint64
- func Tb(value uint64) uint64
- type Base
- type Cable
- type CableKind
- type Connector
- type ConnectorKind
- type Device
- type DeviceSpec
- type Dimm
- type Dimms
- type Disk
- type Disks
- type End
- type ISA
- type Layer1
- type Nic
- type Nics
- type Port
- type Proc
- type Procs
- type Tty
- type Usb
- type UsbVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶
type Cable ¶
A Cable is a physical link between two hosts.
func (*Cable) Breakout ¶
Breakout connects a single port to multiple. This function assumes the first end is the trunk end of the cable.
type CableKind ¶
type CableKind uint16
CableKind defines the type of cable
const ( // UnspecCable indicates the cable kind is not defined UnspecCable CableKind = iota // Cat5 indicates a category 5 copper cable Cat5 // Cat5e indicates a category 5 enhanced copper cable Cat5e // Cat6 indicates a category 6 copper cable Cat6 // DAC indicates a direct attach copper cable DAC // FiberLC indicates a fiber cable with LC type connectors FiberLC // FiberMPOTrunk indicates a fiber trunk cable with MPO connectors FiberMPOTrunk // FiberMPOBreakout indicates a fiber breakout cable with an MPO connector on // the trunk side. FiberMPOBreakout )
type Connector ¶
type Connector struct { Base Kind ConnectorKind Protocol Layer1 Capacity uint64 Port *Port `json:"-" yaml:"-"` }
A Connector couples a cable to a host.
type ConnectorKind ¶
type ConnectorKind uint16
ConnectorKind defines the type of connector.
const ( // UnspecConnector indicates the connector kind is not defined UnspecConnector ConnectorKind = iota // RJ45 type twisted pair connector. RJ45 // SFP type modular connector. SFP // QSFP type modular connector. QSFP // SFPP indicates SFP+ type modular connector SFPP // QSFPP indicates QSFP+ type modular connector QSFPP // SFP28 type modular connector SFP28 // QSFP28 type modular connector QSFP28 // CXP type modular connector CXP // LC type fiber connector LC // MPO type fiber connector MPO )
type Device ¶
type Device struct { Base Procs []Proc Memory []Dimm Nics []Nic Usbs []Usb Ttys []Tty Disks []Disk }
func GenericServer ¶
GenericServer creates a generic server with the provided number of ports and port speed.
func GenericSwitch ¶
GenericSwitch creates a generic switch with the provided radix and port speed.
type DeviceSpec ¶
type DeviceSpec struct { Base Procs map[string]*Procs Memory map[string]*Dimms Nics map[string]*Nics Disks map[string]*Disks }
DeviceSpec contains a keyed set of components. The semantics behind this data structure are that they key uniquely identifies the object, and that when a new object is added with the same key the count is simply incremented. This is uesful for building device specifications that contain many of the same parts. For example consider a computer with 8 identical ram sticks, or 10 identical drives. This data structure contains the spec for just one and increments a counter.
func NewSpec ¶
func NewSpec(d *Device) *DeviceSpec
func (*DeviceSpec) AddDisk ¶
func (s *DeviceSpec) AddDisk(x Disk)
func (*DeviceSpec) AddMemory ¶
func (s *DeviceSpec) AddMemory(x Dimm)
func (*DeviceSpec) AddNic ¶
func (s *DeviceSpec) AddNic(x Nic)
func (*DeviceSpec) AddProc ¶
func (s *DeviceSpec) AddProc(x Proc)
type End ¶
type End []*Connector
An End represents an end of a cable that may have 1 or many connectors (breakout cable).
type Layer1 ¶
type Layer1 uint
Layer 1 (physical) protocol
const ( UnspecProtocol Layer1 = iota // 100 mbps Base100T // 1 gbps Base1000T Base1000X Base1000CX Base1000SX Base1000LX Base1000LX10 Base1000EX Base1000BX10 Base1000ZX // 10 gbps GBase10T GBase10CR GBase10SR GBase10LR GBase10LRM GBase10ER GBase10ZR GBase10LX4 GBase10PR // 25 gbps GBase25CR GBase25SR GBase25LR GBase25ER // 40 gbps GBase40CR4 GBase40SR4 GBase40LR4 GBase40ER4 // 100 gbps GBase100CR4 GBase100SR4 GBase100SR10 GBase100LR4 GBase100ER4 // Console RS232 Uart )
type Proc ¶
type Proc struct { Base ISA ISA `json:"isa"` Family string `json:"family"` BaseFrequency uint64 `json:"basefrequency"` L2 uint64 `json:"l2"` Cores uint64 `json:"cores"` Threads uint `json:"threads"` Tdp uint `json:"tdp"` }
Proc represents a processor
type Usb ¶
type Usb struct {
Version UsbVersion `json:"version"`
}
type UsbVersion ¶
type UsbVersion float32
const ( USB1 UsbVersion = 1.0 USB11 UsbVersion = 1.1 USB20 UsbVersion = 2.0 USB21 UsbVersion = 2.1 USB30 UsbVersion = 3.0 USB31 UsbVersion = 3.1 )