instance

package
v0.0.0-...-cc86db0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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

func GenerateFingerprint() (string, error)

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

func GenerateFingerprintIgnoreSavedHash() (string, error)

GenerateFingerprintIgnoreSavedHash generate fingerprint regardless of whether

a hardware hash already exists.

func IsHybrid

func IsHybrid() bool

func MachineID

func MachineID() (string, error)

MachineID is the same as the machineID() of common/machineid

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 SaveFingerprint(fingerprint string) error

func SaveHardwareInfo

func SaveHardwareInfo(fingerprint string, hardwareHash map[string]string) error

func SaveInstanceInfo

func SaveInstanceInfo(instanceId, fingerprint, regionId, pubKey, priKey, networkMode string)

Types

type HardwareInfo

type HardwareInfo struct {
	Fingerprint  string
	HardwareHash map[string]string
}

func ReadHardwareInfo

func ReadHardwareInfo() (*HardwareInfo, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL