Help us shape the future of Go! Take the 2026 Go Developer Survey

runtimeinfo

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMachineID = errors.New("no stable machine identifier available")

ErrNoMachineID is returned by GetMachineID when no stable machine identifier is available. It may be joined with error catalog errors describing why, so check for it with errors.Is.

Functions

func WithName

func WithName(n string) opt

func WithVersion

func WithVersion(v string) opt

Types

type Machine added in v0.35.0

type Machine struct {
	ID           string
	Hostname     string
	SerialNumber string
	StudioID     string
}

Machine describes the machine the application runs on. ID is the stable identifier; the other fields are descriptive and empty when they could not be determined.

type RuntimeInfo

type RuntimeInfo interface {
	// application
	GetName() string
	SetName(string)

	GetVersion() string
	SetVersion(string)

	// GetMachineID returns the machine the application runs on, or ErrNoMachineID when no stable identifier is available.
	// A non-empty Machine.ID may come with a non-nil error, such as a machine id file that could not be read; the identifier is still usable.
	GetMachineID() (Machine, error)
}

RuntimeInfo describes the runtime the application runs in, grouped into application and machine information.

func New

func New(opts ...opt) RuntimeInfo

Jump to

Keyboard shortcuts

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