power

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PBT_APMSUSPEND         uint32 = 4
	PBT_APMRESUMESUSPEND   uint32 = 7
	PBT_APMRESUMEAUTOMATIC uint32 = 18
)

Defines the type of event

Variables

This section is empty.

Functions

func NewEventListener

func NewEventListener(haltCtx context.Context, eventCh chan uint32) error

NewEventListener will listen for PowerSuspendResumeNotification and send events to the channel

Types

type Cfg

type Cfg struct {
	// contains filtered or unexported fields
}

Cfg allows the caller to change the Power Plan Option in Windows

func NewCfg

func NewCfg() (*Cfg, error)

NewCfg will return a Cfg allowing you to modify the Windows Power Option

func (*Cfg) Set

func (p *Cfg) Set(planName string) (nextPlan string, err error)

Set will change the Windows Power Option to the given power plan name

Jump to

Keyboard shortcuts

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