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 WithVersion ¶
func WithVersion(v string) opt
Types ¶
type Machine ¶ added in v0.35.0
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
Click to show internal directories.
Click to hide internal directories.