open-nomad/client/fingerprint/arch.go
Danielle Tomlinson 66c521ca17 client: Move fingerprint structs to pkg
This removes a cyclical dependency when importing client/structs from
dependencies of the plugin_loader, specifically, drivers. Due to
client/config also depending on the plugin_loader.

It also better reflects the ownership of fingerprint structs, as they
are fairly internal to the fingerprint manager.
2018-12-01 17:10:39 +01:00

26 lines
576 B
Go

package fingerprint
import (
"runtime"
log "github.com/hashicorp/go-hclog"
)
// ArchFingerprint is used to fingerprint the architecture
type ArchFingerprint struct {
StaticFingerprinter
logger log.Logger
}
// NewArchFingerprint is used to create an OS fingerprint
func NewArchFingerprint(logger log.Logger) Fingerprint {
f := &ArchFingerprint{logger: logger.Named("arch")}
return f
}
func (f *ArchFingerprint) Fingerprint(req *FingerprintRequest, resp *FingerprintResponse) error {
resp.AddAttribute("cpu.arch", runtime.GOARCH)
resp.Detected = true
return nil
}