identity

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	// contains filtered or unexported fields
}

Identity implements the Provider interface to manage machine identity and group ID.

func (*Identity) CalculateMachineID

func (*Identity) CalculateMachineID(executor utils.CmdExecutor) (string, error)

CalculateMachineID generates a unique machine ID based on system UUID, serial number, and network serials.

func (*Identity) GetGroupID

func (id *Identity) GetGroupID() (string, error)

GetGroupID retrieves the group ID from a file.

func (*Identity) SaveMachineIDs

func (id *Identity) SaveMachineIDs(machineIDHash string) (initialMachineID string, err error)

SaveMachineIDs saves the initial and current machine IDs to their respective files.

type Provider

type Provider interface {
	// GetGroupID retrieves the group ID from a file.
	GetGroupID() (string, error)
	// CalculateMachineID generates a unique machine ID based on system UUID, serial number, and network serials.
	CalculateMachineID(executor utils.CmdExecutor) (string, error)
	// SaveMachineIDs saves the initial and current machine IDs to their respective files.
	SaveMachineIDs(machineIDHash string) (initialMachineID string, err error)
}

Provider defines the interface for managing machine identity and group ID.

func NewIdentity

func NewIdentity() Provider

NewIdentity creates a new Identity instance with default paths for metrics and machine ID.

Jump to

Keyboard shortcuts

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