osdetail

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: GPL-3.0 Imports: 12 Imported by: 1

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	StatusUnknown uint8 = iota
	StatusRunningStoppable
	StatusRunningNotStoppable
	StatusStartPending
	StatusStopPending
	StatusStopped
)

Service Status

Variables

View Source
var (
	ErrServiceNotFound = errors.New("no service with the given PID was found")
)

Errors

View Source
var (
	ErrServiceNotStoppable = errors.New("the service is not stoppable")
)

Exported errors

Functions

func DisableDNSCache

func DisableDNSCache() error

DisableDNSCache disables the Windows Service "DNS Client" by setting the registry value "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache" to 4 (Disabled). A reboot is required for this setting to take effect.

func EnableColorSupport

func EnableColorSupport() bool

EnableColorSupport tries to enable color support for cmd on windows and returns whether it is enabled.

func EnableDNSCache

func EnableDNSCache() error

EnableDNSCache enables the Windows Service "DNS Client" by setting the registry value "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache" to 2 (Automatic). A reboot is required for this setting to take effect.

func GetAllServiceNames

func GetAllServiceNames() (map[int32]string, error)

GetAllServiceNames returns a list of service names assosicated with svchost.exe processes on Windows.

func GetServiceNames

func GetServiceNames(pid int32) (string, error)

GetServiceNames returns all service names assosicated with a svchost.exe process on Windows.

func GetServiceStatus

func GetServiceStatus(name string) (status uint8, err error)

GetServiceStatus returns the current status of a Windows Service (limited implementation).

func IsAtLeastWindowsNTVersion added in v0.3.0

func IsAtLeastWindowsNTVersion(v string) (bool, error)

IsAtLeastWindowsNTVersion returns whether the current WindowsNT version is at least the given version or newer.

func IsAtLeastWindowsNTVersionWithDefault added in v0.3.0

func IsAtLeastWindowsNTVersionWithDefault(v string, defaultValue bool) bool

IsAtLeastWindowsNTVersionWithDefault is like IsAtLeastWindowsNTVersion(), but keeps the Error and returns the default Value in Errorcase

func IsAtLeastWindowsVersion added in v0.3.0

func IsAtLeastWindowsVersion(v string) (bool, error)

IsAtLeastWindowsVersion returns whether the current Windows version is at least the given version or newer.

func IsAtLeastWindowsVersionWithDefault added in v0.3.0

func IsAtLeastWindowsVersionWithDefault(v string, defaultValue bool) bool

IsAtLeastWindowsVersionWithDefault is like IsAtLeastWindowsVersion(), but keeps the Error and returns the default Value in Errorcase

func SartService

func SartService(name string) (err error)

SartService starts a Windows Service.

func StopService

func StopService(name string) (err error)

StopService stops a Windows Service.

func WindowsNTVersion added in v0.3.0

func WindowsNTVersion() (string, error)

WindowsNTVersion returns the current Windows version.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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