Documentation ¶
Index ¶
- Constants
- Variables
- func DisableDNSCache() error
- func EnableColorSupport() bool
- func EnableDNSCache() error
- func GetAllServiceNames() (map[int32]string, error)
- func GetServiceNames(pid int32) (string, error)
- func GetServiceStatus(name string) (status uint8, err error)
- func IsAtLeastWindowsNTVersion(v string) (bool, error)
- func IsAtLeastWindowsNTVersionWithDefault(v string, defaultValue bool) bool
- func IsAtLeastWindowsVersion(v string) (bool, error)
- func IsAtLeastWindowsVersionWithDefault(v string, defaultValue bool) bool
- func SartService(name string) (err error)
- func StopService(name string) (err error)
- func WindowsNTVersion() (string, error)
Constants ¶
const ( StatusUnknown uint8 = iota StatusRunningStoppable StatusRunningNotStoppable StatusStartPending StatusStopPending StatusStopped )
Service Status
Variables ¶
var (
ErrServiceNotFound = errors.New("no service with the given PID was found")
)
Errors
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 ¶
GetAllServiceNames returns a list of service names assosicated with svchost.exe processes on Windows.
func GetServiceNames ¶
GetServiceNames returns all service names assosicated with a svchost.exe process on Windows.
func GetServiceStatus ¶
GetServiceStatus returns the current status of a Windows Service (limited implementation).
func IsAtLeastWindowsNTVersion ¶ added in v0.3.0
IsAtLeastWindowsNTVersion returns whether the current WindowsNT version is at least the given version or newer.
func IsAtLeastWindowsNTVersionWithDefault ¶ added in v0.3.0
IsAtLeastWindowsNTVersionWithDefault is like IsAtLeastWindowsNTVersion(), but keeps the Error and returns the default Value in Errorcase
func IsAtLeastWindowsVersion ¶ added in v0.3.0
IsAtLeastWindowsVersion returns whether the current Windows version is at least the given version or newer.
func IsAtLeastWindowsVersionWithDefault ¶ added in v0.3.0
IsAtLeastWindowsVersionWithDefault is like IsAtLeastWindowsVersion(), but keeps the Error and returns the default Value in Errorcase
func WindowsNTVersion ¶ added in v0.3.0
WindowsNTVersion returns the current Windows version.
Types ¶
This section is empty.