Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteDiscardFingerprintFile() error
- func GenerateFingerprint() (string, error)
- func GenerateFingerprintIgnoreSavedHash() (string, error)
- func IsHybrid() bool
- func MachineID() (string, error)
- func ReadDiscardFingerprintFile() string
- func ReadFingerprint() string
- func ReadInstanceId() string
- func ReadNetworkMode() string
- func ReadPriKey() string
- func ReadPubKey() string
- func ReadRegionId() string
- func RemoveHardwareInfo()
- func RemoveInstanceInfo()
- func SaveFingerprint(fingerprint string) error
- func SaveHardwareInfo(fingerprint string, hardwareHash map[string]string) error
- func SaveInstanceInfo(instanceId, fingerprint, regionId, pubKey, priKey, networkMode string)
- type HardwareInfo
Constants ¶
View Source
const (
RWPermission os.FileMode = 0600
)
Variables ¶
View Source
var CurrentHwHash = func() (map[string]string, error) { hardwareHash := make(map[string]string) hardwareHash[hardwareID], _ = MachineID() hardwareHash["processor-hash"], _ = processorInfoHash() hardwareHash["memory-hash"], _ = memoryInfoHash() hardwareHash["bios-hash"], _ = biosInfoHash() hardwareHash["system-hash"], _ = systemInfoHash() hardwareHash["hostname-info"], _ = hostnameInfo() hardwareHash[ipaddreddInfo], _ = primaryIpInfo() hardwareHash["macaddr-info"], _ = macAddrInfo() hardwareHash["disk-info"], _ = diskInfoHash() return hardwareHash, nil }
Functions ¶
func DeleteDiscardFingerprintFile ¶
func DeleteDiscardFingerprintFile() error
delete from fingerprint file which is discard
func GenerateFingerprint ¶
GenerateFingerprint generate fingerprint, but if hardware hash already exists and it is similar enough to current hardware the fingerprint in hardware hash will be returned.
func GenerateFingerprintIgnoreSavedHash ¶
GenerateFingerprintIgnoreSavedHash generate fingerprint regardless of whether
a hardware hash already exists.
func ReadDiscardFingerprintFile ¶
func ReadDiscardFingerprintFile() string
read from fingerprint file which is discard
func ReadFingerprint ¶
func ReadFingerprint() string
func ReadInstanceId ¶
func ReadInstanceId() string
func ReadNetworkMode ¶
func ReadNetworkMode() string
func ReadPriKey ¶
func ReadPriKey() string
func ReadPubKey ¶
func ReadPubKey() string
func ReadRegionId ¶
func ReadRegionId() string
func RemoveHardwareInfo ¶
func RemoveHardwareInfo()
func RemoveInstanceInfo ¶
func RemoveInstanceInfo()
func SaveFingerprint ¶
func SaveHardwareInfo ¶
func SaveInstanceInfo ¶
func SaveInstanceInfo(instanceId, fingerprint, regionId, pubKey, priKey, networkMode string)
Types ¶
type HardwareInfo ¶
func ReadHardwareInfo ¶
func ReadHardwareInfo() (*HardwareInfo, error)
Click to show internal directories.
Click to hide internal directories.