String returns a newline-separated output of the HostInfo's component structs' String-ified output
()
| 121 | // String returns a newline-separated output of the HostInfo's component |
| 122 | // structs' String-ified output |
| 123 | func (info *HostInfo) String() string { |
| 124 | return fmt.Sprintf( |
| 125 | "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", |
| 126 | info.Block.String(), |
| 127 | info.CPU.String(), |
| 128 | info.GPU.String(), |
| 129 | info.Accelerator.String(), |
| 130 | info.Memory.String(), |
| 131 | info.Network.String(), |
| 132 | info.Topology.String(), |
| 133 | info.Chassis.String(), |
| 134 | info.BIOS.String(), |
| 135 | info.Baseboard.String(), |
| 136 | info.Product.String(), |
| 137 | info.PCI.String(), |
| 138 | info.USB.String(), |
| 139 | ) |
| 140 | } |
| 141 | |
| 142 | // YAMLString returns a string with the host information formatted as YAML |
| 143 | // under a top-level "host:" key |