Help us shape the future of Go! Take the 2026 Go Developer Survey

pause

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: GPL-2.0 Imports: 6 Imported by: 82

Documentation

Index

Constants

View Source
const (
	EventDevicePaused int = iota
	EventDeviceWake
	EventNetworkPause
	EventNetworkWake
)

Variables

This section is empty.

Functions

func ContextWithDefaultManager deprecated

func ContextWithDefaultManager(ctx context.Context) context.Context

Deprecated: use WithDefaultManager instead.

func ContextWithManager deprecated

func ContextWithManager(ctx context.Context, manager Manager) context.Context

Deprecated: use service.ContextWith instead.

func RegisterTicker added in v0.6.6

func RegisterTicker(manager Manager, ticker *time.Ticker, duration time.Duration, resume func()) *list.Element[Callback]

func WithDefaultManager added in v0.3.0

func WithDefaultManager(ctx context.Context) context.Context

Types

type Callback added in v0.3.0

type Callback = func(event int)

type Manager

type Manager interface {
	DevicePause()
	DeviceWake()
	NetworkPause()
	NetworkWake()
	IsDevicePaused() bool
	IsNetworkPaused() bool
	IsPaused() bool
	WaitActive()
	RegisterCallback(callback Callback) *list.Element[Callback]
	UnregisterCallback(element *list.Element[Callback])
}

func ManagerFromContext deprecated

func ManagerFromContext(ctx context.Context) Manager

Deprecated: use service.ContextWith instead.

Jump to

Keyboard shortcuts

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