GetArchitecture returns the system architecture
()
| 256 | |
| 257 | // GetArchitecture returns the system architecture |
| 258 | func (d *Detector) GetArchitecture() string { |
| 259 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 260 | defer cancel() |
| 261 | |
| 262 | info, err := host.InfoWithContext(ctx) |
| 263 | if err != nil { |
| 264 | d.logger.WithError(err).Warn("Failed to get architecture") |
| 265 | return constants.ArchUnknown |
| 266 | } |
| 267 | |
| 268 | return info.KernelArch |
| 269 | } |
| 270 | |
| 271 | // GetHostname returns the system hostname |
| 272 | func (d *Detector) GetHostname() (string, error) { |