device

package
v0.0.0-...-35e21f9 Latest Latest
Warning

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

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

Documentation

Rendered for windows/amd64

Overview

Package device supports querying information about the local device.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWMIEmptyResult indicates a condition where WMI failed to return the expected values.
	ErrWMIEmptyResult = errors.New("WMI returned without error, but zero results")
)

Functions

func Model

func Model() (string, error)

Model returns the system model.

func Site

func Site(domain string) (string, error)

Site returns the client's Active Directory site code.

func UserProfiles

func UserProfiles() ([]string, error)

UserProfiles returns a list of user profiles on the local device.

Types

type DomainRole

type DomainRole string

DomainRole indicates the role of a host on an Active Directory domain.

var (
	// Workstation corresponds to a domain workstation.
	Workstation DomainRole = "Workstation"
	// Server corresponds to a domain server.
	Server DomainRole = "Server"
	// DomainController corresponds to an Active Directory domain controller.
	DomainController DomainRole = "Domain Controller"
	// RoleUnknown indicates an unknown domain role.
	RoleUnknown DomainRole = "Unknown"
)

func GetDomainRole

func GetDomainRole() (DomainRole, error)

GetDomainRole attempts to determine the host's Active Directory role.

type Type

type Type string

Type is a device type as reported by the system enclosure.

var (
	// Laptop indicates a laptop chassis.
	Laptop Type = "Laptop"
	// Desktop indicates a desktop chassis.
	Desktop Type = "Desktop"
	// Other indicates an "other" chassis type.
	Other Type = "Other"
	// Unknown indicates an "unknown" chassis type.
	Unknown Type = "Unknown"
)

func ChassisType

func ChassisType() (Type, error)

ChassisType attempts to distinguish the chassis type for the device.

type Win32_ComputerSystem

type Win32_ComputerSystem struct {
	DNSHostName  string
	Domain       string
	DomainRole   int
	Model        string
	SystemFamily string
	Manufacturer string
}

Win32_ComputerSystem models the WMI object of the same name.

type Win32_NTDomain

type Win32_NTDomain struct {
	ClientSiteName       string
	DomainControllerName string
}

Win32_NTDomain models the WMI object of the same name.

type Win32_SystemEnclosure

type Win32_SystemEnclosure struct {
	ChassisTypes []int
}

Win32_SystemEnclosure models the WMI object of the same name.

Jump to

Keyboard shortcuts

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