2023-04-10 15:36:59 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2015-08-20 23:29:19 +00:00
|
|
|
package fingerprint
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
|
2018-09-16 00:48:59 +00:00
|
|
|
log "github.com/hashicorp/go-hclog"
|
2015-08-20 23:29:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ArchFingerprint is used to fingerprint the architecture
|
|
|
|
type ArchFingerprint struct {
|
2015-11-05 21:46:02 +00:00
|
|
|
StaticFingerprinter
|
2018-09-16 00:48:59 +00:00
|
|
|
logger log.Logger
|
2015-08-20 23:29:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewArchFingerprint is used to create an OS fingerprint
|
2018-09-16 00:48:59 +00:00
|
|
|
func NewArchFingerprint(logger log.Logger) Fingerprint {
|
|
|
|
f := &ArchFingerprint{logger: logger.Named("arch")}
|
2015-08-20 23:29:19 +00:00
|
|
|
return f
|
|
|
|
}
|
|
|
|
|
2018-12-01 16:10:39 +00:00
|
|
|
func (f *ArchFingerprint) Fingerprint(req *FingerprintRequest, resp *FingerprintResponse) error {
|
2018-01-26 16:21:07 +00:00
|
|
|
resp.AddAttribute("cpu.arch", runtime.GOARCH)
|
2018-01-31 22:03:55 +00:00
|
|
|
resp.Detected = true
|
2018-01-24 14:09:53 +00:00
|
|
|
return nil
|
2015-08-20 23:29:19 +00:00
|
|
|
}
|